ecshop 邮件模板 html,给ecshop后台增加新的邮件模板

给ecshop后台增加新的邮件模板,这个功能很显然,就是我们在使用ecshop的时候,需要给ecshop开发新功能。比如要求给ecshop发送新的业务邮件,这个时候我们的邮件内容,想做到ecshop后台。做统一管理,这个时候就需要我们按照ecshop的规律,去人为的增加邮件可控制的模板。以下我们通过结合示例,来谈谈如何实现。

1:执行以下SQL,在ecshop数据库中增加一条邮件模板记录

insert into ecs_mail_templates(template_code,template_subject,type) values('pay_mail','付款邮件提醒','template')

2:在后台录入邮件模板内容。

亲爱的店长,您好:

快来看看吧,又有客户付款了。

订单号:{$order.order_sn}

支付金额:{$order.order_amount}

系统提醒

{$send_date}

3:通过程序,调用这个ecshop邮件模板。

if ($GLOBALS['_CFG']['send_service_email'] == '1' && $GLOBALS['_CFG']['kf'] != '')

{

$tpl = get_mail_template('pay_mail');

$smarty->assign('order', $order);

$smarty->assign('shop_name', $GLOBALS['_CFG']['shop_name']);

$smarty->assign('send_date', date($GLOBALS['_CFG']['time_format']));

$content = $smarty->fetch('str:' . $tpl['template_content']);

send_mail($_CFG['shop_name'],$GLOBALS['_CFG']['kf'] , $tpl['template_subject'], $content, $tpl['is_html']);

}

以上就是给ecshop后台增加新的邮件模板的方式。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值