【发布时间】:2011-04-04 08:53:08
【问题描述】:
我需要创建一个使用从 cron 运行的观察者发送的特定电子邮件模板。
当我收到电子邮件时,我没有提供的变量的值。
$vars = array(
'product' => $product,
'customer' => $customer
);
$mailTemplate->sendTransactional(
$mailId,
'general',
$customer->getData('email'),
$customer->getData('firstname') . ' ' . $customer->getData('lastname'),
$vars
);
$product 和 $customer 都是模型集合(Product_Collection 和 Customer_Collection)中的对象。
在我的模板中,我尝试像这样访问它们:
Dear {{htmlescape var=$customer.name}},
<p>Check {{htmlescape var=$product.name}}</p>
有什么想法吗?
顺便问一下,我怎样才能为我的产品构建 url? (让客户点击链接查看产品)
【问题讨论】:
-
在应用实际过滤器时,如果您的变量已经到位,请拍手开始调试。最好使用 xdebug.org 并与您的 php ide 一起使用,您可以启动调试会话
标签: php email templates magento