59 if ($this->messageTemplate instanceof \Swift_Message) {
62 } elseif (is_callable($this->messageTemplate)) {
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);
An exception for terminatinating execution or to throw for unit testing.
Base class for all mail handlers.
SwiftMailerHandler uses Swift_Mailer to send the emails.
send($content, array $records)
{Send a mail with the given content.}
__construct(\Swift_Mailer $mailer, $message, $level=Logger::ERROR, $bubble=true)
__get($name)
BC getter, to be removed in 2.0.
buildMessage($content, array $records)
Creates instance of Swift_Message to be sent.
const ERROR
Runtime errors.
catch(Exception $e) $message