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
......@@ -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);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment