Exemplo n.º 1
0
 public function generate(TemplateInterface $template) : MimeMessage
 {
     $mimeMessage = new MimeMessage();
     $textTemplate = $template->getTextTemplate();
     if ($textTemplate) {
         $textMimePart = $this->createTextMimePart($textTemplate, $template->getParams());
         $mimeMessage->addPart($textMimePart);
     }
     $htmlTemplate = $template->getHtmlTemplate();
     if ($htmlTemplate) {
         $htmlMimePart = $this->createHtmlMimePart($htmlTemplate, $template->getParams());
         $mimeMessage->addPart($htmlMimePart);
     }
     return $mimeMessage;
 }