diff --git a/EventListener/EmailSubscriber.php b/EventListener/EmailSubscriber.php index 85c7040..03712dd 100644 --- a/EventListener/EmailSubscriber.php +++ b/EventListener/EmailSubscriber.php @@ -36,8 +36,8 @@ public function __construct(TemplateProcessor $templateProcessor) public static function getSubscribedEvents() { return [ - EmailEvents::EMAIL_ON_SEND => ['onEmailGenerate', 0], - EmailEvents::EMAIL_ON_DISPLAY => ['onEmailGenerate', 0] + EmailEvents::EMAIL_ON_SEND => ['onEmailGenerate', 300], + EmailEvents::EMAIL_ON_DISPLAY => ['onEmailGenerate', 0], ]; } @@ -52,7 +52,7 @@ public static function getSubscribedEvents() public function onEmailGenerate(Events\EmailSendEvent $event) { $this->logger->info('onEmailGenerate MauticAdvancedTemplatesBundle\EmailSubscriber'); - $content = $event->getContent(); + $content = $event->getEmail()->getCustomHtml(); $content = $this->templateProcessor->processTemplate($content, $event->getLead()); $event->setContent($content); if ( empty( trim($event->getPlainText()) ) ) {