


How to notify the administrator of Empire CMS orders, feedback information, contributions and messages by email
The example in this article describes the method of notifying the administrator of Empire CMS orders, feedback information, submissions and messages by email. Share it with everyone for your reference. The specific implementation method is as follows:
1. Set the administrator's email address and sending parameters
Backend, system settings, system parameter settings
Basic attribute label: Administrator's email. Future notification emails will be sent to this mailbox
FTP/EMAIL tag: If the host supports the mail function, I personally feel that this may be more efficient. If the host does not support it, it doesn’t matter. You can also use SMTP and set it. The method is the same as the email client.
It should be noted that if you want to use a gmail account to send, it will be more troublesome to implement. Gmail's SMTP requires SSL, not to mention that the mail sending class that comes with Empire does not support SSL, which is where the mail is set up in the Empire's backend. There is no SSL option provided, so there is no need to worry about it. Just use your domestic email account to send it.
2. Add a new function to send emails to the administrator
Find e\class\SendEmail.inc.php and add the following code at the end:
Code 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 .= "\r\n\r\n此邮件由系统自动发出,请管理员尽快处理\n\r"; $sm=EcmsToSendMail($pr['email'],$subject,$msgtext); return $sm; }
It is recommended to study "Empire cms tutorial"
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, at about line 184
The code is as follows:
AddDd($_POST);
Add in front of this line:
The code is as follows:
@include("../class/SendEmail.inc.php"); SendNoticeToAdmin("有新订单!订单号".$_POST[ddno],$_POST);
Complete, this is just a reminder function, so there is no need for the email interface or anything like that. After considering it, the administrator can just go to the Empire backend to process it after receiving the email.
2. When there is a new submission
Modify e\class\qinfofun.php at about line 850
The code is as follows:
printerror("AddQinfoSuccess",$reurl,1);
Add in front of this line:
The code is as follows:
@include('SendEmail.inc.php'); SendNoticeToAdmin("收到来自".$add['title']."的投稿",$add);
3. When there is new information feedback:
Modify e\class\q_functions.php, at about line 468
The code is as follows:
$reurl=DoingReturnUrl("../tool/feedback/?bid=$bid",$add['ecmsfrom']);
Add in front of this line:
The code is as follows:
@include("SendEmail.inc.php"); SendNoticeToAdmin("收到来自".$add['title']."的信息反馈",$add);
4. When there is a new message
Modify e\enews\index.php, at about line 215
The code is as follows:
AddGbook($_POST);
Add in front of this line:
The code is as follows:
@include("../class/SendEmail.inc.php"); SendNoticeToAdmin("收到新留言",$_POST);
5. A member registers on the website (if the registration needs to be reviewed, receive this email for management Members can go to the backend for review in time)
Modify e\enews\index.php, at about line 74.
The code is as follows:
register($username,$password,$repassword,$email);
In front of this line Add:
The code is as follows:
@include('../class/SendEmail.inc.php'); SendNoticeToAdmin("新会员注册,用户名:".$username,$_POST);
6. E-mail verification is required to enable registration in the backend of the website. After the verification is passed, members will receive a welcome email. Since this email is for members, Therefore, we need to pay attention to the formatting of the content.
(1) Add a new file under e\class and name it user_template_register.txt. The content is as follows (for reference only, you can modify it yourself)
Welcome [!--USERNAME--] to register for this website.
(2) Modify e\class\qmemberfun.php, in about line 188
The code is as follows:
printerror('ActUserSuccess',$public_r['newsurl'],1);
Add in front of 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],"欢迎注册",$msgtext);
Hope this article will be helpful to everyone’s Imperial CMS website building and secondary development.
The above is the detailed content of How to notify the administrator of Empire CMS orders, feedback information, contributions and messages by email. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

The mobile settings of Empire CMS are located in the "Mobile Template" of the "Template Management" module. The specific steps include: enabling the template, selecting the application channel, editing the template content, and saving the settings.

The Empire CMS sitemap can be found by accessing the config.inc.php file and checking the dositemap settings. If set to "on", sitemap is enabled. The sitemap path is located in the sitemapurl setting and can be accessed via a browser or downloaded via FTP.

The ideal location for the Empire CMS template file is /e/template/default/skin/default/. Secondly, it can also be placed in /e/data/skins/ and /e/skin/. You need to pay attention to maintaining the folder structure and setting file permissions. and regular backups.

The Imperial CMS database configuration file is located in the website root directory e/config/db.inc.php. It contains the following configuration information: $dbhost: database server address $dbuser: database user name $dbpass: database password $dbname: database name $dbport :Database port $dbcharset: Database character set

Empire CMS template download location: Official template download: https://www.phome.net/template/ Third-party template website: https://www.dedecms.com/diy/https://www.0978.com.cn /https://www.jiaocheng.com/Installation method: Download template Unzip template Upload template Select template

The automatic publishing interface of Empire CMS is located at /e/api/web/postinfo.php. The usage steps are as follows: visit /e/api/web/postinfo.php address and use HTTP POST to submit the article title, column ID, category ID, author and article The content and other data interfaces will return a response in JSON format, which contains the publishing results and article ID.

The imperial cms Baidu active push plug-in is located in the root directory /e/api/baidu/push.php. The specific configuration steps are as follows: 1. Upload the plug-in file to the specified path. 2. Configure the "Baidu Active Push" option in the Imperial CMS background, including push address, API Key and push interval. 3. Get Baidu push information: Push address: https://data.zz.baidu.com/urls?site=YOUR_SITE&token=YOUR_API_KEY, API Key: log in to Baidu search resource platform to obtain. 4. Update the API Key regularly and set a reasonable push interval.

Yes, Empire CMS is a free and open source content management system (CMS). It is a lightweight CMS that is feature-rich and easy to use. Empire CMS is licensed under the GNU General Public License (GPL), which means it is free to download, install and use. For commercial use, it offers a paid version that offers additional features and support such as ad management, online payments, and premium technical support.
