Home > Article > CMS Tutorial > How does the Imperial CMS Mall system implement the function of sending order email reminders after online payment?
How does the Empire CMS Mall system implement the function of sending order email reminders after online payment?
The example in this article describes the function of the Imperial CMS Mall system to send order email reminders after online payment. Share it with everyone for your reference, the details are as follows:
It is recommended to study "Empire cms tutorial"
Empire CMS is a powerful content management system, and its mall function is also very Powerful, when a user places an order and pays, how do we know that a user has placed an order? Because we can't be in the background of the website all the time, constantly refreshing the page to see if there are orders. The most common way is to use emails to remind us that someone has placed an order.
How to achieve this function Woolen cloth?
The first step: Configure the Empire backend system settings - System parameter settings - FTP/EMAIL Configure EMAIL here
Generally use 126 mailboxes, my configuration is as follows:
Email sending mode: SMTP module sending
SMTP server: smtp.126.com
SMTP port: Write any one, I wrote 25
Sender address: Write an email address, such as jitaxiong@sina.cn
Name of the sender: Just write a
Whether login verification is required: click "Yes"
Email login username: Email username, such as webmaster (excluding @126.com)
Email login password:
After the configuration is completed, set the administrator email (in the system settings) and save it.
The second step is to modify the source file. There are two methods
(1). e/class/ShopSysFun.php search code printerror($mess,$location,1);
Add the following code to the previous line:
The code is as follows:
$email=array('jitaxing@sina.cn'); $subject='邮件标题'; $content='邮件内容'; @include(ECMS_PATH.'e/class/SendEmail.inc.php'); EcmsToSendMail($email,$subject,$content);
After modification. The email sent by this method can only serve as a reminder and does not include orders. The relevant content, title and content are all fixed.
(2) This method can include part of the order content. The steps are as follows:
1. Add a function to send emails to the administrator
Find eclassSendEmail.inc.php, add the following code at the end:
The code is as follows:
//给管理员信箱发送通知邮件新增函数 function SendNoticeToAdmin($subject,$body){ global $empire,$dbtbpre; $empire=new mysqlquery(); $pr=$empire->fetch1("select email from {$dbtbpre}enewspublic limit 1″); if(is_array($body)){ foreach($body as $value){ $key=key($body); next($body); $msgtext .= "$key:"."$value"."n"; } }else{ $msgtext=$body; } $msgtext .= "rnrn此邮件由系统自动发出,请管理员尽快处理nr"; $sm=EcmsToSendMail($pr['email'],$subject,$msgtext); return $sm; }
2. Modify eenewsindex.php, at about line 184
AddDd($_POST);Add in front of this line:
The code is as follows:
@include("../class/SendEmail.inc.php"); SendNoticeToAdmin("有新订单!订单号".$_POST[ddno],$_POST);
The above is the detailed content of How does the Imperial CMS Mall system implement the function of sending order email reminders after online payment?. For more information, please follow other related articles on the PHP Chinese website!