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

第一步:更改数据库

用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.ecshop119.com/">http://www.ecshop119.com</a><br /><br />ECSHOP模板屋小秘书提醒<br /><br />{$send_date}</p>', 1330402034, 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;}

文章转载:http://www.gehut.cn/

(0)

相关推荐

  • PHP核心之模板引擎Smarty

    Smarty Smarty简介 概念 为了分工合作,模板页面中最好不要出现PHP的代码 需要将表现和内容相分离 官方Smarty 概念 Smarty是用PHP编写的优秀的模板引擎 Smarty可以实现 ...

  • ECSHOP会员注册自动发送邮件欢迎信息

    第一步: 数据库->ecs_mail_templates邮件模板表中插入一条注册发送邮件的记录. INSERT INTO ecs_mail_templates (template_id, tem ...

  • ECSHOP会员注册实现注册自动发送邮件验证码

    第一.从数据库入手 用mysql管理工具找到 ecs_mail_templates  表插入一条 注册发送邮件的数据 INSERT INTO `ecs_mail_templates` (`templa ...

  • ECSHOP后台会员注册审核功能

    ECSHOP会员注册登录后台审核功能涉及到的页面开发说明: 1.后台user_list.htm 语言项-->zh_cn\admin users.php 2.后台user_info.htm 语言项 ...

  • ECSHOP邮件服务器设置发送邮件会员注册发送邮箱验证码

    最新QQ邮箱设置教程,最好是注册QQ企业邮箱,这样给用户发送验证码很少几率进垃圾箱 下面介绍普通QQ邮箱设置教程 一.首先开启QQ邮箱的SMTP服务 首先,要开启QQ邮箱的SMTP功能,开启方法如下: ...

  • ECSHOP会员注册成功以后自动升级为对应会员等级

    各位ECSHOP网店系统用户大家好,欢迎来到ECSHOP教程网图文教程,今天为大家详细解说一下ECSHOP会员注册后自动升级为对应会员等级ECSHOP教程网ECSHOP视频教程也再不断的完善与跟进,期 ...

  • 关于实名推荐郁达夫少年文学院新会员的通知

    郁达夫少年文学院公告2017-4 关于实名推荐郁达夫少年文学院                          新会员的通知 为传承郁达夫人文精神,拓展文学传播渠道,2017年3月,郁达夫研究学会发 ...

  • ECSHOP邮件验证注册会员自动发送验证码

    Cshop的验证邮件默认只能用户登录用户中心点击发送才能收到,这里让他改为用户注册时自动发送.适当编写邮件内容也可以让他同时具有注册通知邮件的效果. 在user.php 里面的 大概235行      ...

  • ECSHOP会员等级,ECSHOP会员注册等级

    各位ECSHOP网店系统用户大家好,欢迎来到ECSHOP教程网图文教程,今天为大家详细解说一下ECSHOP会员等级,ECSHOP会员注册等级. ECSHOP教程网ECSHOP视频教程也再不断的完善与跟 ...

  • ECSHOP会员注册订单分成推荐设置说明教程

    首先从后台左面的菜单栏选择推荐管理->推荐设置 ,打开如图 打开后默认是选择的推荐注册分成 推荐注册分成 是指有人从你推荐的地址点击注册后给你的分成. 推荐时效:这里可以选择 小时/天/周,在前 ...