Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PRESIDECMS-2707 next scheduled send date in past error #1360

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions system/handlers/admin/emailCenter/CustomTemplates.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -804,22 +804,27 @@ component extends="preside.system.base.AdminHandler" {
}

if ( args.sendMethod == "scheduled" ){
var nowish = Now();
args.sendDate = args.scheduleType == "repeat" ? ( template.schedule_next_send_date ?: "" ) : ( template.schedule_date ?: "" );

if ( IsDate( args.sendDate ) && args.sendDate > Now() ) {
if ( IsDate( args.sendDate ) && args.sendDate > nowish ) {
args.estimatedSendCount = emailMassSendingService.getTemplateRecipientCount( templateId );
}

if ( args.scheduleType == "repeat" ) {
if ( IsDate( args.sendDate ) ) {
defaultNotice.message = translateResource( uri="cms:emailcenter.next.send.date.alert", data=[ DateTimeFormat( args.sendDate, "d mmm, yyyy HH:nn"), NumberFormat( args.estimatedSendCount ) ] );
if ( args.sendDate > nowish ) {
defaultNotice.message = translateResource( uri="cms:emailcenter.next.send.date.alert", data=[ DateTimeFormat( args.sendDate, "d mmm, yyyy HH:nn"), NumberFormat( args.estimatedSendCount ) ] );
} else {
defaultNotice.message = translateResource( uri="cms:emailcenter.next.send.date.in.past.alert", data=[ DateTimeFormat( args.sendDate, "d mmm, yyyy HH:nn") ] );
}
} else {
defaultNotice.message = translateResource( uri="cms:emailcenter.next.send.date.unknown.alert" );
defaultNotice.class = "warn";
defaultNotice.icon = "fa-exclamation-triangle";
}
} else if ( IsDate( args.sendDate ) ) {
if ( args.sendDate > Now() ) {
if ( args.sendDate > nowish ) {
defaultNotice.message = translateResource( uri="cms:emailcenter.send.date.alert", data=[ DateTimeFormat( args.sendDate, "d mmm, yyyy HH:nn"), NumberFormat( args.estimatedSendCount ) ]);
} else if ( args.queued ) {
defaultNotice.message = translateResource( uri="cms:emailcenter.sending.alert", data=[ NumberFormat( args.queued ), NumberFormat( args.sent ) ] );
Expand Down
1 change: 1 addition & 0 deletions system/i18n/cms.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1882,6 +1882,7 @@ emailcenter.send.date.unknown.alert=This email has not been scheduled to send. E
emailcenter.send.date.in.past.alert=This email has as scheduled send date in the past: <strong>{1}</strong>. However, no emails have been sent. You may wish to edit the email settings to schedule the send.
emailcenter.next.send.date.alert=Next scheduled send: <strong>{1}</strong>. Estimated recipient count: <strong>{2}</strong>.
emailcenter.next.send.date.unknown.alert=Next scheduled send: unknown
emailcenter.next.send.date.in.past.alert=This email has a scheduled send date in the past: <strong>{1}</strong>. This will self-correct shortly.
emailcenter.manual.send.alert=This email is set to send manually. Use the <strong>"Send"</strong> button at the top right of your screen to begin the sending process.

emailcenter.blueprints.page.title=Manage Email blueprints
Expand Down