diff --git a/code/Newsletter/NewsletterEmailProcess.php b/code/Newsletter/NewsletterEmailProcess.php index 04773d7f..7ba4a5ed 100755 --- a/code/Newsletter/NewsletterEmailProcess.php +++ b/code/Newsletter/NewsletterEmailProcess.php @@ -106,17 +106,17 @@ class NewsletterEmailProcess extends BatchProcess { } else { $resent = false; } - - $this->newsletter->SentDate = 'now'; - $this->newsletter->Status = 'Send'; - $this->newsletter->write(); - - $message = "statusMessage('Sent " . count( $this->objects ) . " emails successfully','good');"; - - if( $resent ) - return $message."resent_ok( '{$this->nlType->ID}', '{$this->newsletter->ID}' )"; - else - return $message."draft_sent_ok( '{$this->nlType->ID}', '{$this->newsletter->ID}' )"; + + $this->newsletter->SentDate = 'now'; + $this->newsletter->Status = 'Send'; + $this->newsletter->write(); + + // Call the success message JS function with the Newsletter information + if( $resent ) { + return "resent_ok( '{$this->nlType->ID}', '{$this->newsletter->ID}', '".count( $this->objects )."' )"; + } else { + return "draft_sent_ok( '{$this->nlType->ID}', '{$this->newsletter->ID}', '".count( $this->objects )."' )"; + } } } ?> \ No newline at end of file diff --git a/javascript/NewsletterAdmin_left.js b/javascript/NewsletterAdmin_left.js index 2144a960..320a7b71 100755 --- a/javascript/NewsletterAdmin_left.js +++ b/javascript/NewsletterAdmin_left.js @@ -213,7 +213,7 @@ SiteTreeNode.prototype.getPageFromServer = function() { $('Form_EditForm').getPageFromServer(newPageID, type, otherID, openTabName); }; -function draft_sent_ok( newsletterID, draftID ) { +function draft_sent_ok( newsletterID, draftID, numEmails ) { var draftsListNode = $('drafts_' + newsletterID); var sentListNode = $('sent_' + newsletterID); var draftNode = $('draft_' + newsletterID + '_' + draftID ); @@ -221,11 +221,11 @@ function draft_sent_ok( newsletterID, draftID ) { draftsListNode.removeTreeNode( draftNode ); draftNode.id = 'sent_' + newsletterID + '_' + draftID; sentListNode.appendTreeNode( draftNode, null ); - statusMessage('Sent email to mailing list', 'good'); + statusMessage('Sent newsletter to mailing list. Sent ' + numEmails + ' emails successfully.', 'good'); } -function resent_ok( newsletterID, sentID ) { - statusMessage('Resent email to mailing list', 'good'); +function resent_ok( newsletterID, sentID, numEmails ) { + statusMessage('Resent newsletter to mailing list. Sent ' + numEmails + ' emails successfully.', 'good'); } function reloadSiteTree() {