The method of realizing the function of sending order email reminder after online payment in Imperial CMS Mall system
This article will explain in detail how to realize the function of sending order email reminder after online payment in Imperial CMS Mall system. The editor thinks it is very practical, so I share it for you to make a reference. I hope you can get something after reading this article.
Imperial CMS is a powerful content management system, and its mall is also very powerful. When users place an order and pay, how do we know that a user has placed an order? Because we can't always be in the background of the website, constantly refreshing the page to see if there are any orders, the most common way is to remind us by email that someone has placed an order.
How to do this function?
Step 1: configure Imperial backend system Settings-system Parameter Settings-FTP/EMAIL configure EMAIL here
I usually use 126 mailboxes. My configuration is as follows:
Mail delivery mode: sent by SMTP module
SMTP server: smtp.126.com
SMTP port: write any one, I write 25
Sender's address: write an email address, such as jitaxiong@sina.cn
The sender said: write any one.
Whether login authentication is required: click "Yes"
Mailbox login user name: mailbox user name, such as webmaster (excluding @ 126.com)
Email login password:
After the configuration, set the administrator mailbox (in the system settings) and save it.
The second step is to modify the source file. There are two ways
(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=' message title'; $content=' message content'; @ include (ECMS_PATH.'e/class/SendEmail.inc.php'); EcmsToSendMail ($email,$subject,$content)
After the revision, it can be done. The email sent by this method can only serve as a reminder, does not contain the relevant content of the order, the title and content are fixed.
(2) this method can include part of the order, and the steps are as follows:
1. New function to send email to administrator
Find eclassSendEmail.inc.php and add the following code at the end:
The code is as follows:
/ / send notification email to administrator mailbox add function function SendNoticeToAdmin ($subject,$body) {global $empire,$dbtbpre;$empire=new mysqlquery (); $pr=$empire- > fetch2 ("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 this email is automatically sent by the system. Please deal with nr as soon as possible." $sm=EcmsToSendMail ($pr ['email'], $subject,$msgtext); return $sm;}
two。 Modify the eenewsindex.php at approximately 184lines
AddDd ($_ POST); precede this line by:
The code is as follows:
@ include (".. / class/SendEmail.inc.php"); SendNoticeToAdmin ("New order! order number". $_ post [ddno], $_ POST). This is the way to realize the function of sending order email reminders after online payment in Imperial CMS Mall system. I hope the above content can be helpful to you and learn more knowledge. If you think the article is good, you can share it for more people to see.