if (!
empty($body)) { $body =
$this->
trackFilter($body,
$mailing['id'
]);
$mail->
setBodyHtml($body);
} if (!
empty($bodyText)) { $bodyText =
$this->
altFilter($bodyText);
$mail->
setBodyText($bodyText);
} $subject =
$template->
fetch('string:' .
$mailing['subject'
],
$template);
$mail->
clearSubject();
$mail->
setSubject($subject);
$mail->
clearRecipients();
$mail->
addTo($user['email'
]);
$mail->
setAssociation(NewsletterMailFilter::NEWSLETTER_MAIL, true
);
$validator =
$this->container->
get(EmailValidator::
class);
if (!
$validator->
isValid($user['email'
])) { echo "Skipped invalid email\n";
// SW-4526
// Don't `continue` with next iteration without setting user's lastmailing
// else the mailing.status will never be set to 2
// and sending the mail will block