From ead770775da39c56f01b8ed34d328085cbe00dd1 Mon Sep 17 00:00:00 2001 From: james Date: Wed, 2 Mar 2011 05:24:09 +0000 Subject: [PATCH] Make sending emails with HTML work properly if there's no HTML yet --- common.inc.functions.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common.inc.functions.php b/common.inc.functions.php index dc22a58..9574dd0 100644 --- a/common.inc.functions.php +++ b/common.inc.functions.php @@ -341,7 +341,12 @@ function email_send($val,$to,$sub_subject=array(),$sub_body=array()) { //we dont want to translate these -- the emails themselves should be bi-multi-lingual if they need to be. $subject=$r->subject; $body=$r->body; - $bodyhtml=$r->body; + $bodyhtml=$r->bodyhtml; + + //catch the old emails that might not yet have a html version (they'll only have html + //once they've been edited and saved) + if(!$bodyhtml) + $bodyhtml=nl2br($body); /* Eventually we should just do this with communication_replace_vars() */ if(count($sub_subject)) {