Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The case of Empire CMS order, feedback, contribution and message email notification administrator

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail the cases of Imperial CMS orders, feedback, contribution and email notification to the administrator. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

The specific implementation methods are as follows:

First, set the administrator's e-mail address and sending parameters

Background, system settings, system parameter settings

Basic attribute tag: administrator mailbox. Future notification emails will be sent to this mailbox.

FTP/EMAIL tag: if the host supports the mail function, then I feel that it may be more efficient to use this function, and it doesn't matter if the host doesn't support it. You can also use SMTP, which is set in the same way as the mail client.

It should be noted that if you want to use the gmail account to send it is more troublesome, gmail smtp needs ssl, not to mention the Empire's own mail sending class does not support ssl, that is, the Empire backstage setting mail does not provide ssl options, so do not bother, just use the domestic mailbox account to send.

Second, add a function to send email to administrators

Find e\ class\ SendEmail.inc.php, and add the following code at the end:

The code is as follows:

/ / add functions 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. = "\ r\ n\ r\ nThis email is sent automatically by the system. Please handle it as soon as possible by the administrator\ n\ r"; $sm=EcmsToSendMail ($pr ['email'], $subject,$msgtext); return $sm;}

Recommended to learn the Imperial cms course

Third, send an email to the administrator, the following are different scenarios, which can be modified freely as needed.

1. When there is a new order

Modify e\ enews\ index.php in approximately 184lines

The code is as follows:

AddDd ($_ POST)

Add before this line:

The code is as follows:

@ include (".. / class/SendEmail.inc.php"); SendNoticeToAdmin ("New order! order number". $_ post [ddno], $_ POST)

Finish the job, this is just a reminder function, so you don't have to think about the email interface, just go to the Empire backstage to deal with it after the administrator receives the email.

two。 When there are new contributions

Modify e\ class\ qinfofun.php, at approximately 850 lines

The code is as follows:

Printerror ("AddQinfoSuccess", $reurl,1)

Add before this line:

The code is as follows:

@ include ('SendEmail.inc.php'); SendNoticeToAdmin ("received contributions from. $add [' title'].", $add)

3. When there is new feedback:

Modify e\ class\ q_functions.php, at approximately 468 lines

The code is as follows:

$reurl=DoingReturnUrl (".. / tool/feedback/?bid=$bid", $add ['ecmsfrom'])

Add before this line:

The code is as follows:

@ include ("SendEmail.inc.php"); SendNoticeToAdmin ("received feedback from. $add ['title'].", $add)

4. When there is a new message

Modify e\ enews\ index.php in approximately 215lines

The code is as follows:

AddGbook ($_ POST)

Add before this line:

The code is as follows:

@ include (".. / class/SendEmail.inc.php"); SendNoticeToAdmin ("New message received", $_ POST)

5. Some members register on the website (if the registration needs to be reviewed, the administrator can go to the backstage in time to check if you receive this email.)

Modify e\ enews\ index.php in about 74 lines.

The code is as follows:

Register ($username,$password,$repassword,$email)

Add before this line:

The code is as follows:

@ include ('.. / class/SendEmail.inc.php'); SendNoticeToAdmin ("new member registration, user name:. $username,$_POST)

6. Website backstage to enable registration requires email verification, members will receive a welcome letter after verification, because this email is for members to read, so the content format should be paid attention to in typesetting.

(1) add a file under e\ class and name it user_template_register.txt. The contents are as follows (for reference only and can be modified by yourself)

Welcome [!-- USERNAME--] to register for this website.

(2) modify e\ class\ qmemberfun.php at approximately 188 lines

The code is as follows:

Printerror ('ActUserSuccess',$public_r [' newsurl'], 1)

Add before this line:

The code is as follows:

@ include ('SendEmail.inc.php'); $msgtext=file_get_contents ("user_template_register.txt"); $msgtext=str_replace (' [!-- USERNAME--]', $r [username], $msgtext); EcmsToSendMail ($r [username], "Welcome to register", $msgtext) So much for the case of Empire CMS order, feedback, contribution and email notification. I hope the above content can be helpful to you and learn more. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report