From 8138fa674af4d56e80f9c3adcf5897c37c3d5fa1 Mon Sep 17 00:00:00 2001 From: Cameron Date: Sat, 17 Jan 2015 02:01:38 -0800 Subject: [PATCH] Fix for extra blank lines in html emails. --- e107_handlers/mail.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/e107_handlers/mail.php b/e107_handlers/mail.php index 834450bd6..9f4d7945e 100644 --- a/e107_handlers/mail.php +++ b/e107_handlers/mail.php @@ -690,7 +690,16 @@ class e107Email extends PHPMailer { $tp = e107::getParser(); - $eml['shortcodes']['BODY'] = !empty($eml['body']) ? $tp->toEmail($eml['body']) : ''; + if(!empty($eml['html']) || strip_tags($eml['template']) != $eml['template']) // HTML Email. + { + $eml['shortcodes']['BODY'] = !empty($eml['body']) ? $eml['body'] : ''; // using toEmail() on html templates adds unnecessary
to code. + } + else // Plain Text Email. + { + $eml['shortcodes']['BODY'] = !empty($eml['body']) ? $tp->toEmail($eml['body']) : ''; + } + + $eml['shortcodes']['BODY'] = !empty($eml['body']) ? $eml['body'] : ''; // $tp->toEmail($eml['body']) : ''; $eml['shortcodes']['SUBJECT'] = !empty($eml['subject']) ?$eml['subject'] : ''; $eml['shortcodes']['THEME'] = ($this->previewMode == true) ? e_THEME_ABS.$this->pref['sitetheme'].'/' : e_THEME.$this->pref['sitetheme'].'/'; // Always use front-end theme path.