46 $this->mailer->send($this->
buildMessage($content, $records));
59 if ($this->messageTemplate instanceof \Swift_Message) {
62 } elseif (is_callable($this->messageTemplate)) {
63 $message = call_user_func($this->messageTemplate, $content, $records);
66 if (!
$message instanceof \Swift_Message) {
67 throw new \InvalidArgumentException(
'Could not resolve message as instance of Swift_Message or a callable returning it');
72 $message->setSubject($subjectFormatter->format($this->getHighestRecord($records)));
86 if (
$name ===
'message') {
87 trigger_error(
'SwiftMailerHandler->message is deprecated, use ->buildMessage() instead to retrieve the message', E_USER_DEPRECATED);
92 throw new \InvalidArgumentException(
'Invalid property '.
$name);
const ERROR
Runtime errors.
__get($name)
BC getter, to be removed in 2.0.
catch(Exception $e) $message
__construct(\Swift_Mailer $mailer, $message, $level=Logger::ERROR, $bubble=true)
Create styles array
The data for the language used.
send($content, array $records)
{}
buildMessage($content, array $records)
Creates instance of Swift_Message to be sent.
Base class for all mail handlers.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
SwiftMailerHandler uses Swift_Mailer to send the emails.