如何使用一些PHP规则高度自定义Magento销售电子邮件模板?

时间:2012-10-01 20:21:00

标签: magento

我需要将客户购买的产品(课程)名称仅用于付款确认后发送的电子邮件。

但据我所知,电子邮件模板不接受PHP代码来执行某些规则。

我需要的是像

Congratulations,
Your subscription for Course 1, Course 4 and Course 8 is confirmed.

所以,我想我需要获取产品,将它们放入字符串中等等......

我怎样才能让它以这种方式运作?有没有办法拆分订购的产品,并在Transactional电子邮件CMS中制作这些PHP规则?

2 个答案:

答案 0 :(得分:3)

Magento已经在做这样的事了。

价:

默认发货电子邮件模板,app/locale/en_US/template/email/sales/shipment_new.html

{{layout handle="sales_email_order_shipment_items" shipment=$shipment order=$order}}
{{block type='core/template' area='frontend' template='email/order/shipment/track.phtml' shipment=$shipment order=$order}}

Mage_Core_Model_Email_Template_Filter::layoutDirective()::blockDirective()处理。

答案 1 :(得分:0)

本教程指出:

http://www.webspeaks.in/2011/06/customize-new-order-email-template-in.html

你可以在一个phtml文件中获得$ order,你可以将你需要的php放在一起,以获得你想要达到的目标。

相关问题