Merge new line email template fix

This commit is contained in:
Hillel Coren 2017-03-19 15:35:20 +02:00
parent 7305c9e483
commit 3bcba163c4

View File

@ -36,7 +36,7 @@ trait SendsEmails
$value = $this->$field; $value = $this->$field;
if ($value) { if ($value) {
return $value; return preg_replace("/\r\n|\r|\n/", ' ', $value);
} }
} }
@ -66,7 +66,7 @@ trait SendsEmails
} }
if ($message) { if ($message) {
$template .= "$message<p/>\r\n\r\n"; $template .= "$message<p/>";
} }
return $template . '$footer'; return $template . '$footer';
@ -91,6 +91,8 @@ trait SendsEmails
$template = $this->getDefaultEmailTemplate($entityType, $message); $template = $this->getDefaultEmailTemplate($entityType, $message);
} }
$template = preg_replace("/\r\n|\r|\n/", ' ', $template);
// <br/> is causing page breaks with the email designs // <br/> is causing page breaks with the email designs
return str_replace('/>', ' />', $template); return str_replace('/>', ' />', $template);
} }