public function send(MailMessage $message) { $template = $this->templating->loadTemplate($message->getTemplate()); $message->setSubject($template->renderBlock('subject', $message->getData()))->setSender($message->getSender())->setReplyTo(key($message->getSender()))->setTo($message->getTo())->setBody($template->renderBlock('body_text', $message->getData()))->addPart($template->renderBlock('body_html', $message->getData()), 'text/html'); return $this->mailer->send($message); }