Skip to content
Snippets Groups Projects
Commit 2762ba2f authored by Georgi Mateev's avatar Georgi Mateev
Browse files

[TASK] 1519 added better error messages for the newsletter

parent 21614022
No related branches found
No related tags found
1 merge request!18[TASK] 1520 add Newsletter functionalty to sg_mail
......@@ -428,13 +428,14 @@ class NewsletterController extends ActionController {
foreach ($recipients as $recipient) {
try {
$mailTemplateService->setToAddresses($recipient['email']);
$mailTemplateService->setToAddresses($recipient['username']);
$mailTemplateService->setMarkers(['user' => $recipient]);
// no real error handling here, one must check the MailQueue
$mailTemplateService->sendEmail(FALSE);
} catch (\Exception $e) {
// Invalid email address could not be loaded to queue
$errorRecipients[] = $recipient['username'];
$errorRecipients[] = $recipient['uid'] . ' - '
. $recipient['username'] . ' (' . $e->getMessage() . ')';
}
}
$mailIsSend = TRUE;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment