diff --git a/Classes/Service/MailTemplateService.php b/Classes/Service/MailTemplateService.php index a08a3678179b316361e7cc1ca111a0829b4bac94..79b778b847b74a2b5fed291ea6332f16c733d8e0 100644 --- a/Classes/Service/MailTemplateService.php +++ b/Classes/Service/MailTemplateService.php @@ -944,10 +944,7 @@ class MailTemplateService { empty($overwrittenEmailBody) ? $templateContent : $overwrittenEmailBody ); - // insert
tags, but replace every instance of three or more successive breaks with just two. $emailBody = $emailView->render(); - $emailBody = \nl2br($emailBody); - $emailBody = \preg_replace('/([\s]*){3,}/', '

', $emailBody); $layout = $this->getLayoutSource($layoutId, $siteRootId); $emailHTMLHead = ''; @@ -955,6 +952,10 @@ class MailTemplateService { $emailHTMLHead = $layout->getHeadContent(); $emailBody = \str_replace('###CONTENT###', $emailBody, $layout->getContent()); } + + // insert
tags, but replace every instance of three or more successive breaks with just two. + $emailBody = \nl2br($emailBody); + $emailBody = \preg_replace('/([\s]*){3,}/', '

', $emailBody); $this->mailBodyToSend = '' . $emailHTMLHead . '' . $emailBody . ''; }