forked from science-ation/science-ation
Make sending emails with HTML work properly if there's no HTML yet
This commit is contained in:
parent
2b808e5e48
commit
ead770775d
@ -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.
|
//we dont want to translate these -- the emails themselves should be bi-multi-lingual if they need to be.
|
||||||
$subject=$r->subject;
|
$subject=$r->subject;
|
||||||
$body=$r->body;
|
$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() */
|
/* Eventually we should just do this with communication_replace_vars() */
|
||||||
if(count($sub_subject)) {
|
if(count($sub_subject)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user