欢迎光临
我们一直在努力

ecshop注册会员发送欢迎信息邮件

第一步: 数据库->ecs_mail_templates邮件模板表中插入一条注册发送邮件的记录。

INSERT INTO ecs_mail_templates (template_id, template_code, is_html, template_subject, template_content, last_modify, last_send, type) VALUES ('', 'send_reg', '1', '爱立美家具网-欢迎信息', '尊敬的{$user_name},感谢您注册成为{$shop_name}的会员! <br />请您在发表言论时,遵守当地法律法规。<br />
如果您有什么疑问可以联系管理员,Email: 37431300@qq.com。<br />{$shop_name}<br />{$send_date}', '1387836051', '0', 'template');

第二步:在语言文件 languages/zh_cn/admin/mail_template.php /* 模板描述 */下添加

$_LANG['send_reg'] = '欢迎信息模板';

第三步:增加PHP处理逻辑

flow.php和user.php中均有会员注册逻辑,所以这两个文件都要增加邮件发送代码

flow.php 大概286行->elseif (!empty($_POST[‘act’]) && $_POST[‘act’] == ‘signup’) 里面增加如下代码:

/* 注册会员邮件欢迎 */
$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']);

user.php 大概234行->/* 写入密码提示问题和答案 */这个判断的下面增加如下代码:

/* 注册会员邮件欢迎 */
$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']);
赞(0) 打赏
未经允许不得转载:程序开发爱好者 » ecshop注册会员发送欢迎信息邮件
分享到: 更多 (0)

网站设计及开发、微应用及微网站开发、微信公众平台开发、 HTML5手机网站开发、网络整合营销、APP开发、软件开发及企业电商服务

联系我们