Skip to content

Commit

Permalink
Add support for subjects
Browse files Browse the repository at this point in the history
  • Loading branch information
kuzmany committed Feb 20, 2020
1 parent c85666b commit 306e4b6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions EventListener/EmailSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ public static function getSubscribedEvents()
public function onEmailGenerate(Events\EmailSendEvent $event)
{
$this->logger->info('onEmailGenerate MauticAdvancedTemplatesBundle\EmailSubscriber');
$content = $event->getEmail()->getCustomHtml();
$content = $this->templateProcessor->processTemplate($content, $event->getLead());
$subject = $this->templateProcessor->processTemplate($event->getEmail()->getSubject(), $event->getLead());
$event->setSubject($subject);

$content = $this->templateProcessor->processTemplate($event->getEmail()->getCustomHtml(), $event->getLead());
$event->setContent($content);
if ( empty( trim($event->getPlainText()) ) ) {
$event->setPlainText( (new PlainTextHelper($content))->getText() );
Expand Down

0 comments on commit 306e4b6

Please sign in to comment.