给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后台增加新的邮件模板的方式。

上帝助自助者。

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

相关文章:

你感兴趣的文章:

标签云: