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

Added intro message to maillog processing email #104

Merged
merged 4 commits into from
Dec 17, 2016
Merged
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
17 changes: 10 additions & 7 deletions public_html/lists/admin/actions/processqueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,9 @@ function finish($flag, $message, $script_stage)
{
global $nothingtodo, $counters, $messageid;
if ($flag == 'error') {
$subject = s('Maillist errors');
$subject = s('Message queue processing errors');
} elseif ($flag == 'info') {
$subject = s('Maillist Processing info');
$subject = s('Message queue processing report');
}
if (!$nothingtodo && !$GLOBALS['inRemoteCall']) {
processQueueOutput(s('Finished this run'), 1, 'progress');
Expand All @@ -348,17 +348,20 @@ function finish($flag, $message, $script_stage)
if (!$GLOBALS['inRemoteCall'] && !TEST && !$nothingtodo && SEND_QUEUE_PROCESSING_REPORT) {
$reportSent = false;

## @@TODO work out a way to deal with the order of processing the plugins
## as that can make a difference here.
// Execute plugin hooks for sending report
// @@TODO work out a way to deal with the order of processing the plugins
// as that can make a difference here.
foreach ($GLOBALS['plugins'] as $pluginname => $plugin) {
if (!$reportSent) {
$reportSent = $plugin->sendReport($subject, $message);
}
}

// If plugins have not sent the report, send it the default way
if (!$reportSent) {
## fall back to the central one
$message .= "\n\n" . s('To stop receiving these reports read:') . ' https://resources.phplist.com/system/config/send_queue_processing_report' . "\n\n";
sendReport($subject, $message);
$messageWithIntro = s('The following events occured while processing the message queue:') . "\n" . $message;
$messageWithIntroAndFooter = $messageWithIntro . "\n\n" . s('To stop receiving these reports read:') . ' https://resources.phplist.com/system/config/send_queue_processing_report' . "\n\n";
sendReport($subject, $messageWithIntroAndFooter);
}
}
}
Expand Down