Commit 4cef368d authored by Stephen Shkardoon's avatar Stephen Shkardoon

FIX Prevent failing emails stopping entire queue

Previous to this, certain rare conditions could case the sender to fail and require a manual restart.
Now, it'll mark an email as failed as soon as we get an exception.
parent 892b34ed
......@@ -214,7 +214,12 @@ class NewsletterSendController extends BuildTask {
//send out the mails
foreach($queueItems2 as $item) {
$item->send($newsletter, $recipientsMap[$item->RecipientID]);
try {
$item->send($newsletter, $recipientsMap[$item->RecipientID]);
} catch (Exception $e) {
$item->Status = 'Failed';
$item->write();
}
}
}
......@@ -233,4 +238,4 @@ class NewsletterSendController extends BuildTask {
}
}
}
\ No newline at end of file
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment