【问题标题】:How to get or pass email variables into phtml如何获取或传递电子邮件变量到 phtml
【发布时间】:2014-11-19 17:51:27
【问题描述】:

好吧,伙计们,浪费了半天时间,现在我放弃了。

在我的“您的帐户已激活”电子邮件下,我想将客户唯一 ID 代码添加到电子邮件中,该代码无非是客户的初始值 + 我使用 php 动态创建的客户 ID。

现在我有客户 ID {{var customer.getId()}} 进入电子邮件,我有

{{block type='core/template' area='frontend' template='email/customer_uniq_id.phtml'  customer_id_var='{{var customer.getId()}}' }}

我试图将带有 ID 的 customer_id_var 传递给我的 customer_uniq_id.phtml

但它不起作用,我已经尝试过:

echo Mage::getModel('core/variable')->loadByCode('customer.ID')->getValue('plain');

还有其他代码,但什么都没有。

关于如何在发送电子邮件时获取客户 ID 的任何线索?

大家好

【问题讨论】:

  • 你试过magic getter吗:$this->getCustomerIdVar()
  • 它给了我 {{var customer.getId()}} 而不是实际的 id...
  • 在你的phtml文件中使用Mage::getSingleton('customer/session')->getCustomer()->getId()怎么样
  • 谢谢,但在发送电子邮件时会话不会处于活动状态...

标签: php magento email


【解决方案1】:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-30
    • 2016-12-01
    • 2017-11-30
    • 2019-07-25
    • 2013-02-13
    相关资源
    最近更新 更多