========================================================================================= Add a image header to email = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = SERVER SIDE = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = ========================================================================================= [S1] [NEW] lib/app/CImgHeader.class.php ========================================================================================= [S2] lib/app/CAppMailer.class.php : 122-124 ----------------------------------------------------------------------------------------- // [BEGIN] 2021-11-26 add a header image if(strpos($body,"")!=false){$mail->isHTML(true);} // [END] 2021-11-26 add a header image ========================================================================================= [S3] admin/mod/cntsrec/CBend_trans.class.php => Send Ticket ID ----------------------------------------------------------------------------------------- //-- send email $px = array(); $px["subject"] = $data->requ["subject"]; //-- [BEGIN] 2021-11-26 imgheader $px["body"]=CImgHeader::renderBody($data->requ["body"],$idata); //-- [END] 2021-11-26 imgheader $px["receiver-email"] = $data->requ["email"]; $px["bcc-email"] = $idata["pp-email"]; $px["replyto-email"] = $idata["pp-email"]; $maillog_id = CAppMailer::send( $px ); ========================================================================================= [S4] cn/include/CServer.class.php => Prize Notification ----------------------------------------------------------------------------------------- //-- [BEGIN] 2021-11-26 imgheader if(!empty($idata["imgheader"])){$plhx["imgheader"]=$idata["imgheader"];} //-- [END] 2021-11-26 imgheader ----------------------------------------------------------------------------------------- private static function sendPrizeMail( $plhx ) { self::setupMailContents( $plhx, $subject, $body ); $px = array(); $px["subject"] = $subject; //-- [BEGIN] 2021-11-26 imgheader $px["body"]=CImgHeader::renderBody($body,$plhx); //-- [END] 2021-11-26 imgheader $px["receiver-email"] = $plhx["email"]; $px["bcc-email"] = $plhx["bcc-email"]; $px["replyto-email"] = $plhx["replyto-email"]; return CAppMailer::send( $px ); } ----------------------------------------------------------------------------------------- private static function setupMailContents( $plhx, &$subject, &$body ) { $tpl = CCfgDb::get( "tpl.wprize" ); $subject = $tpl["subject"]; $body = $tpl["body"]; foreach( $plhx as $key => $val ) { //-- [BEGIN] 2021-11-26 imgheader if(!is_array($val)){ //-- [END] 2021-11-26 imgheader $plh = "%" . str_replace("_","-",$key) . "%"; $subject = str_replace($plh,$val,$subject); $body = str_replace($plh,$val,$body); //-- [BEGIN] 2021-11-26 imgheader } //-- [END] 2021-11-26 imgheader } } ========================================================================================= [S5] CHandler_PACNTS.class.php => Transaction Notification ----------------------------------------------------------------------------------------- //-- [BEGIN] 2021-11-26 imgheader if(!empty($idata["imgheader"])){$plhx["imgheader"]=$idata["imgheader"];} //-- [END] 2021-11-26 imgheader ----------------------------------------------------------------------------------------- private function sendTransMail( $plhx ) { $this->setupMailContents( $plhx, $subject, $body ); $px = array(); $px["subject"] = $subject; //-- [BEGIN] 2021-11-26 imgheader $px["body"]=CImgHeader::renderBody($body,$plhx); //-- [END] 2021-11-26 imgheader $px["receiver-email"] = $plhx["email"]; $px["bcc-email"] = $plhx["bcc-email"]; $px["replyto-email"] = $plhx["replyto-email"]; return CAppMailer::send( $px ); } ----------------------------------------------------------------------------------------- private function setupMailContents( $plhx, &$subject, &$body ) { $tpl = CCfgDb::get( "tpl.trans" ); $subject = $tpl["subject"]; $body = $tpl["body"]; foreach( $plhx as $key => $val ) { //-- [BEGIN] 2021-11-26 imgheader if(!is_array($val)){ //-- [END] 2021-11-26 imgheader $plh = "%" . str_replace("_","-",$key) . "%"; $subject = str_replace($plh,$val,$subject); $body = str_replace($plh,$val,$body); //-- [BEGIN] 2021-11-26 imgheader } //-- [END] 2021-11-26 imgheader } $b = !empty($plhx["url-hostpage"]); $subject = $this->processUrlHostPageBlock($subject,$b); $body = $this->processUrlHostPageBlock($body,$b); } ========================================================================================= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = CLIENT SIDE = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = ========================================================================================= [C1] admin/mod/cntsrec/CFend_cntsrec.class.php : 22-24 ----------------------------------------------------------------------------------------- //-- [BEGIN] 2021-11-26 imgheader 'inppic/CFend_inppic', //-- [END] 2021-11-26 imgheader ========================================================================================= [C2] admin/mod/cntsrec/js/CCntsRec.js : 40-43 ----------------------------------------------------------------------------------------- //-- [BEGIN] 2021-11-26 imgheader //-- init CInpPic initCInpPic(); //-- [END] 2021-11-26 imgheader ========================================================================================= [C3] admin/mod/cntsrec/CBend_cntsrec.class.php : 60-62 ----------------------------------------------------------------------------------------- //-- [BEGIN] 2021-11-26 imgheader $data->idata_prev=$idata; //-- [END] 2021-11-26 imgheader ========================================================================================= [C4] admin/mod/cntsrec/CCntsRec.class.php : 84-101 ----------------------------------------------------------------------------------------- public static function saveData( $data ) { //-- [BEGIN] 2021-11-26 imgheader if(isset($data->idata_prev["imgheader"])){ $pic_prev=$data->idata_prev["imgheader"]; }else{ $pic_prev=array("pic_id"=>0,"ext"=>""); } $pic_next=$data->vx["idata"]["imgheader"]; if($pic_prev["pic_id"]!=$pic_next["pic_id"]){ if($pic_prev["pic_id"]){ CPic::setStatus($pic_prev["pic_id"],0); } if($pic_next["pic_id"]){ CPic::setStatus($pic_next["pic_id"],1); } } //-- [END] 2021-11-26 imgheader ========================================================================================= [C5] locale/en/cntsrec/locale.settings.inc.php : 41 ----------------------------------------------------------------------------------------- $lca["psect:title:imgheader"]="Header for Email Notification"; ========================================================================================= [C6] admin/mod/cntsrec/tpl.settings.panel.inc.php : 243-268 -----------------------------------------------------------------------------------------
=========================================================================================