ecshop用户注册后发送邮件给客户功能
发布:smiling 来源: PHP粉丝网 添加日期:2014-06-19 11:13:26 浏览: 评论:0
第一步:当然是从数据库入手,用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}您好!
- nrn 恭喜你注册为www.phpfensi.com会员rnrn{$shop_name}rn{$send_date}’, 1228373714, 0, ‘template’);
template_content 是邮件发邮件内容字段 根据自己的需要编辑不同的内容 当然等你添加成功后 去后台邮件模板管理可以去做管理编辑。
第二步:在语言文件加入一行记录 找languages/zh_cn/admin/mail_template.php 打开 添加 $_LANG['send_reg'] = ‘注册确认模板’;
第三步:修改注册文件 打开 user.php 找到如下代码:
- if (register($username, $password, $email, $other) !== false)
- {
- show_message(sprintf($_LANG['register_success'], $username . “$user->ucdata”), $_LANG['profile_lnk'], ‘user.php’, ‘info’, true);
- }
在160行左右修改为:
- if (register($username, $password, $email, $other) !== false)
- {
- $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']);
- show_message(sprintf($_LANG['register_success'], $username . “$user->ucdata”), $_LANG['profile_lnk'], ‘user.php’, ‘info’, true);
Tags: ecshop用户注册 发送邮件
相关文章
- ·ecshop实现smtp发送邮件(2021-05-09)
推荐文章
热门文章
最新评论文章
- 写给考虑创业的年轻程序员(10)
- PHP新手上路(一)(7)
- 惹恼程序员的十件事(5)
- PHP邮件发送例子,已测试成功(5)
- 致初学者:PHP比ASP优秀的七个理由(4)
- PHP会被淘汰吗?(4)
- PHP新手上路(四)(4)
- 如何去学习PHP?(2)
- 简单入门级php分页代码(2)
- php中邮箱email 电话等格式的验证(2)