【发布时间】:2019-08-11 21:06:00
【问题描述】:
我正在使用默认的奖励电子邮件模板,如下所示
{{template config_path="design/email/header_template"}}
<p class="greeting">{{trans "%name," name=$customer.getName()}}</p>
<p>
{{trans "You have %points_balance points that may be used in our store:" points_balance=$points_balance}}
<a href="{{store url=""}}">{{var store.getFrontendName()}}</a>.
</p>
<p>{{trans '<a href="%unsubscription_url">Unsubscribe</a> from these notifications.' unsubscription_url=$unsubscription_url|raw}}</p>
{{template config_path="design/email/footer_template"}}
根据模板,我应该在奖励积分更新的电子邮件中收到客户姓名,但我收到的是这样的
我无法理解为什么不显示客户名称而是显示 %name,
在电子邮件模板中我测试了{{var customer.getFirstName}}, {{var customer.firstname}}, {{trans "name" name="customer.name"}}, {{trans "name" name="customer.getname"}}, {{customer}} ...
似乎客户变量在电子邮件模板中不起作用
在代码文件中我检查了文件
1)vendor/magento/module-reward/Model/Reward.php
2)vendor/magento/framework/Filter/Template.php
但是没有找到具体的原因。我知道通过覆盖等我可以明确添加客户名称,但我想知道它不起作用的确切原因。我正在使用 Magento 2.1.4 EE。你能指导我从哪里得到任何线索吗?
谢谢!
【问题讨论】: