Skip to content
Snippets Groups Projects
Commit 59ebb7fb authored by Torsten Oppermann's avatar Torsten Oppermann
Browse files

[TASK] Replacing every instance of three or more successive breaks with just two

parent 38a49e2d
No related branches found
No related tags found
No related merge requests found
......@@ -167,9 +167,12 @@ class MailTemplateService {
$emailBody = $emailView->render();
if ($this->ignoreMailQueue) {
// insert <br /> tags, but replace every instance of three or more successive breaks with just two.
$emailBody = nl2br($emailBody);
$emailBody = preg_replace('/(<br[\s]?[\/]?>[\s]*){3,}/', '<br /><br />', $emailBody);
$this->mailMessage->setSubject($this->subject);
$this->mailMessage->setBody(nl2br($emailBody), 'text/html');
$this->mailMessage->setBody($emailBody, 'text/html');
$this->mailMessage->send();
} else {
$this->addMailToMailQueue($emailBody);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment