Make sending emails with HTML work properly if there's no HTML yet

This commit is contained in:
james 2011-03-02 05:24:09 +00:00
parent 2b808e5e48
commit ead770775d

View File

@ -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)) {