|
@@ 415-419 (lines=5) @@
|
| 412 |
|
$recipientParams[self::CONTENT_ITEMS] = $this->orderContentItems(array_merge($recipientContentItems, $params[self::CONTENT_ITEMS])); |
| 413 |
|
$recipientParams['_locale'] = $recipient->getPreferredLocale(); |
| 414 |
|
|
| 415 |
|
if (sizeof($recipientParams[self::CONTENT_ITEMS]) == 0) { |
| 416 |
|
$this->logger->warning("The newsletter for '".$recipient->getDisplayName()." <".$recipient->getEmail().">' has not been sent. It would have been empty.", $params); |
| 417 |
|
|
| 418 |
|
return $recipient->getEmail(); |
| 419 |
|
} |
| 420 |
|
|
| 421 |
|
$subject = $this->getRecipientSpecificNewsletterSubject($params[self::CONTENT_ITEMS], $recipientContentItems, $params, $recipient, $recipient->getPreferredLocale()); |
| 422 |
|
|
|
@@ 426-435 (lines=10) @@
|
| 423 |
|
// render and send the email with the right wrapper-template |
| 424 |
|
$sent = $this->mailer->sendSingleEmail($recipient->getEmail(), $recipient->getDisplayName(), $subject, $recipientParams, $wrapperTemplate.".txt.twig", $recipient->getPreferredLocale()); |
| 425 |
|
|
| 426 |
|
if ($sent) { |
| 427 |
|
// save that this recipient has recieved the newsletter |
| 428 |
|
return null; |
| 429 |
|
|
| 430 |
|
} else { |
| 431 |
|
$this->logger->error("The newsletter for ".$recipient->getDisplayName()." <".$recipient->getEmail()."> could not be sent!", $params); |
| 432 |
|
|
| 433 |
|
return $recipient->getEmail(); |
| 434 |
|
|
| 435 |
|
} |
| 436 |
|
} |
| 437 |
|
|
| 438 |
|
/** |