网站地图    收藏   

主页 > 后端 > ecshop教程 >

ecshop用户注册后发送邮件给客户功能 - ecshop

来源:自学PHP网    时间:2014-11-28 23:31 作者: 阅读:

[导读] 第一步:当然是从数据库入手,用mysql管理工具找到 ecs_mail_templates 表插入一条 注册发送邮件的数据 INSERTINTO`ecs_mail_templates`(`template_id`,`template_code`,`is_html`,`template_subj...

ecshop用户注册后发送邮件给客户功能

第一步:当然是从数据库入手,用mysql管理工具找到 ecs_mail_templates 表插入一条 注册发送邮件的数据.

  1. 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}您好! 
  2. 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 找到如下代码:

  1. if (register($username$password$email$other) !== false) 
  2. show_message(sprintf($_LANG['register_success'], $username . “$user->ucdata”), $_LANG['profile_lnk'], ‘user.php’, ‘info’, true); 

在160行左右修改为:

  1. if (register($username$password$email$other) !== false) 
  2.     { 
  3.      $tpl = get_mail_template(’send_reg’); 
  4.      $smarty->assign(’shop_name’, $_CFG['shop_name']); 
  5.      $smarty->assign(’send_date’, date($_CFG['time_format'])); 
  6.     $smarty->assign(‘user_name’,$username); 
  7.      $content = $smarty->fetch(’str:’ . $tpl['template_content']); 
  8.      send_mail($_CFG['shop_name'], $email$tpl['template_subject'], $content$tpl['is_html']); 
  9.      show_message(sprintf($_LANG['register_success'], $username . “$user->ucdata”), $_LANG['profile_lnk'], ‘user.php’, ‘info’, true); 

自学PHP网专注网站建设学习,PHP程序学习,平面设计学习,以及操作系统学习

京ICP备14009008号-1@版权所有www.zixuephp.com

网站声明:本站所有视频,教程都由网友上传,站长收集和分享给大家学习使用,如由牵扯版权问题请联系站长邮箱904561283@qq.com

添加评论