diff --git a/common.inc.functions.php b/common.inc.functions.php index af6b77e..d26b284 100644 --- a/common.inc.functions.php +++ b/common.inc.functions.php @@ -338,8 +338,10 @@ function email_send($val,$to,$sub_subject=array(),$sub_body=array()) { $q=mysql_query("SELECT * FROM emails WHERE val='$val'"); if($r=mysql_fetch_object($q)) { - $subject=i18n($r->subject); - $body=i18n($r->body); + //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; /* Eventually we should just do this with communication_replace_vars() */ if(count($sub_subject)) { @@ -353,6 +355,13 @@ function email_send($val,$to,$sub_subject=array(),$sub_body=array()) { } } + //do bodyhtml as well + if(count($sub_body)) { + foreach($sub_body AS $sub_k=>$sub_v) { + $bodyhtml=ereg_replace("\[$sub_k\]","$sub_v",$bodyhtml); + } + } + if($r->from) $fr=$r->from; else if ($config['fairmanageremail']) @@ -363,7 +372,7 @@ function email_send($val,$to,$sub_subject=array(),$sub_body=array()) { //only send the email if we have a from if($fr) { //send using RMail - email_send_new($to,$fr,$subject,$body); + email_send_new($to,$fr,$subject,$body,$bodyhtml); } else echo error(i18n("CRITICAL ERROR: email '%1' does not have a 'From' and the Fair Manager Email is not configured",array($val),array("email key name")));