您现在的位置是:首页 > cms教程 > Ecshop商城教程Ecshop商城教程

ecshop新会员注册自动发送邮件通知管理员

马仁2023-12-31Ecshop商城教程已有人查阅

导读步骤一:更改数据库用MySQL管理工具找到 ecs_mail_templates表插入一条新会员注册邮件提醒模板数据。INSERT INTO ecs_mai

步骤一:更改数据库
用MySQL管理工具找到 ecs_mail_templates表插入一条新会员注册邮件提醒模板数据。
INSERT INTO ecs_mail_templates (template_id, template_code, is_html, template_subject, template_content, last_modify, last_send, type) VALUES(16, 'remind_of_new_reg', 1, '新会员注册提醒', '<p>
亲爱的管理员,您好:<br /><br />快来看看吧,ECSHOP代码号又有新会员注册了。<br
/><br
/>-----------------------------------------------------------------<br
/><br />会员:{$user_name} <br /><br
/>邮箱:{$email}<br /><br />管理中心登陆:<a target="_blank"
href="http://www.ebingou.cn/">http://www.ebingou.cn</a><br
/><br />ECSHOP代码号小秘书提醒<br /><br
/>{$send_date}</p>', 13*********, 0, 'template');
修改商店设置WAP设置选项卡的位置,在其之前增加选项卡“邮件设置”。
UPDATE ecs_shop_config SET id=id+1 WHERE id=9;
UPDATE ecs_shop_config SET id=id+100, parent_id=parent_id+1 WHERE parent_id=9;
INSERT INTO eyo_shop_config (id, parent_id, code, type, store_range, store_dir, value, sort_order) VALUES
(910, 9, 'send_reg_email', 'select', '1,0', '', '1', 1);
将客服邮件地址输入框从网店信息选项卡移至邮件设置选项卡。
UPDATE ecs_shop_config SET id=901 WHERE code="service_email";
第二步: 更改语言文件。
/languages/zh_cn/admin/mail_template.php中添加:
$_LANG['remind_of_new_reg'] = '新会员注册提醒模板';
/languages/zh_cn/admin/shop_config.php中添加:
$_LANG['cfg_desc']['service_email'] = '用于接收新订单提醒、新会员注册提醒等商城运营邮件,多个邮箱请用英文逗号分隔。';
$_LANG['cfg_name']['send_reg_email'] = '新会员注册时是否给管理员发送邮件';
$_LANG['cfg_range']['send_reg_email']['0'] = '不发送邮件';
$_LANG['cfg_range']['send_reg_email']['1'] = '发送邮件';
$_LANG['cfg_desc']['send_service_email'] = "商城信息中的客服邮件地址或管理员邮件地址不为空时,该选项有效。";
第三步:增加PHP处理逻辑,flow.php和user.php中均有会员注册逻辑,所以这两个文件都要增加邮件提醒代码。
/flow.php中大概275行:if (register(trim($_POST[‘username’]), trim($_POST[‘password’]), trim($_POST[‘email’])))下增加:
if (register(trim($_POST['username']), trim($_POST['password']), trim($_POST['email'])))
{
/* 用户注册成功,如果需要,发邮件给管理员 */
if ($GLOBALS['_CFG']['send_reg_email'] == '1')
{
$tpl = get_mail_template('remind_of_new_reg');
$smarty->assign('shop_name', $_CFG['shop_name']);
$smarty->assign('send_date', date($_CFG['time_format']));
$smarty->assign('user_name', trim($_POST['username']));
$smarty->assign('email', trim($_POST['email']));
$content = $smarty->fetch('str:' . $tpl['template_content']);
if($_CFG['service_email'] != '')
{
//ECSHOP默认不支持多个邮件发送,将逗号分隔的邮件地址分解成数组,再循环逐个发送。
$arrEmail = explode("," ,$_CFG['['service_email']);
foreach($arrEmail as $arrEmailValue)
{
send_mail($_CFG['shop_name'], $arrEmailValue, $tpl['template_subject'], $content, $tpl['is_html']); //发给管理员
}
}
}
ecs_header("Location: flow.php?step=consignee\n");
exit;
}
/user.php中约235行:
/* 注册会员邮件确认通知 */
$tpl = get_mail_template('send_reg');
$smarty->assign('shop_name', $_CFG['shop_name']);
$smarty->assign('send_date', date($_CFG['time_format']));
$smarty->assign('user_name',$username);
$content = $smarty->fetch('str:' . $tpl['template_content']);
send_mail($_CFG['shop_name'], $email, $tpl['template_subject'], $content, $tpl['is_html']);
下面增加:
if (register(trim($_POST['username']), trim($_POST['password']), trim($_POST['email'])))
{
/* 用户注册成功,如果需要,发邮件给客服和管理员 */
if ($GLOBALS['_CFG']['send_reg_email'] == '1')
{
$tpl = get_mail_template('remind_of_new_reg');
$smarty->assign('shop_name', $_CFG['shop_name']);
$smarty->assign('send_date', date($_CFG['time_format']));
$smarty->assign('user_name', trim($_POST['username']));
$smarty->assign('email', trim($_POST['email']));
$content = $smarty->fetch('str:' . $tpl['template_content']);
if($_CFG['service_email'] != '')
{
//ECSHOP默认不支持多个邮件发送,将逗号分隔的邮件地址分解成数组,再循环逐个发送。
$arrEmail = explode("," ,$_CFG['service_email']);
foreach($arrEmail as $arrEmailValue)
{
send_mail($_CFG['shop_name'], $arrEmailValue, $tpl['template_subject'], $content, $tpl['is_html']); //发给管理员
}
}
}
ecs_header("Location: flow.php?step=consignee\n");
exit;
}

本文标签:

很赞哦! ()

相关教程

相关源码

  • (自适应响应式)化妆美容口红唇膏化妆品模板pbootcms源码下载基于PbootCMS开发的响应式模板,为化妆品品牌、美容机构打造,通过优雅的视觉呈现提升产品展示效果与品牌调性。采用时尚杂志排版风格,色卡系统规范产品展示。微交互动画增强用户体验,智能推荐算法提升产品关联展示效果。查看源码
  • (自适应)调节阀门气动球阀控制阀网站模板源码下载为调节阀门、气动球阀等工业设备企业打造的响应式网站模板,基于PbootCMS系统开发。突出产品参数展示与技术文档管理功能,通过专业化的布局设计有效呈现工业设备特性,适配各类终端访问需求。查看源码
  • (PC+WAP)蓝色弹簧针厂家探针充电连接器设备网站源码下载基于PbootCMS开发的响应式模板,为弹簧针、探针连接器等电子元器件企业设计。模板采用工业蓝主色调,突出产品技术特性,支持多维度展示连接器产品的规格参数与应用场景,帮助制造企业建立专业线上展示平台。查看源码
  • 自适应新闻资讯技术博客个人网站pbootcms模板该模板基于PbootCMS开源内核深度开发,该模板适用于游戏新闻网站、游戏博客等企业或个人网站,新闻资讯技术博客pbootcms模板;采用六级分辨率断点适配技术查看源码
  • (自适应)文案文档作文写作word资源网站模板下载本模板基于PbootCMS系统深度开发,针对电影解说、文案分享类网站的特殊需求设计。采用响应式布局技术,确保在手机端和桌面端都能呈现专业的内容展示效果,帮助运营者高效管理影视解说资源。查看源码
  • (自适应)蓝色自动溶剂萃取仪器设备类网站pbootcms模板下载本模板为溶剂萃取设备、实验室仪器等精密仪器行业设计,采用PbootCMS内核开发,具有高度专业性和行业适配性。模板设计充分考虑了仪器设备行业展示需求,能够呈现各类精密仪器的技术参数、应用场景和解决方案。查看源码
分享笔记 (共有 篇笔记)
验证码:

本栏推荐