From 3614c95a99d4869764cf232867cea27ed308fb15 Mon Sep 17 00:00:00 2001 From: Kevin von Spiczak Date: Thu, 25 Jun 2020 15:58:13 +0200 Subject: [PATCH] [BUGFIX] replace newlines in mail layout too Newlines were only replaced with
's in the mail body, but not in the configured layout for this mail. This resulted in missing newlines in the layout (everything was more or less in one line). --- Classes/Service/MailTemplateService.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Classes/Service/MailTemplateService.php b/Classes/Service/MailTemplateService.php index a08a367..79b778b 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 . ''; } -- GitLab