1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Fix for newlines in email templates

This commit is contained in:
Hillel Coren 2017-03-19 09:15:21 +02:00
parent c401947997
commit 64a92bbc2e

View File

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