广州传奇网络

地址:广州市天河区东圃大马路富华楼C座

电话:13808825895

邮箱:gz020wbs@163.com

QQ:1564443073

网址:http://www.020wbs.com/

首页 > 二次开发Ecshop二次开发 > ecshop商城会员注册实现注册自动发送邮件功能

二次开发Ecshop二次开发

二次开发Ecshop二次开发

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('', 'send_reg', 0, '注册确认', '{$user_name}您好!<br>\r\n<br>\r\n 恭喜你注册为会员\r\n\r\n{$shop_name}\r\n{$send_date}', 1228373714, 0, 'template');


template_content 是邮件发邮件内容字段 根据自己的需要编辑不同的内容 当然等你添加成功后 去后台邮件模板管理可以去做管理编辑。

第二、在语言文件加入一行记录 找languages/zh_cn/admin/mail_template.php 打开 添加 $_LANG['send_reg'] = '注册确认模板';

第三、修改注册文件 打开 user.php 找到

show_message(sprintf($_LANG['register_success'], $username . "$user->ucdata"), $_LANG['profile_lnk'], 'user.php', 'info', true);

在前面插入:

$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']);

即:在(约233行)

$ucdata = empty($user->ucdata)? "" : $user->ucdata;

show_message(sprintf($_LANG['register_success'], $username . "$user->ucdata"), $_LANG['profile_lnk'], 'user.php', 'info', true);

之间插入以上代码。

修改完毕注册测试去邮箱查看是否有新邮件,当然这个前提是我们的网站要可以发送邮件。