1

I'm running Magento EE 1.14.2.1 (CE 1.9.2.1) and have noticed what appears to be a regression in functionality with added parameters in email templates.

Assuming I have a sales/order class rewrite which adds a template parameter to the $mailer like so:

// ...
if ($this->hasSomeData()) {
    $templateParams['some_data'] = 'Hello World';
}
$mailer->setTemplateParams($templateParams);
// ...

Then I access it in an email template like so:

{{depend order.hasSomeData())}}<p>Some data: {{var some_data}}</p>{{/depend}}

Prior to upgrading to Magento CE 1.9.2.1 or EE 1.14.2.1 this line was correctly rending "Some data: Hello World" in the email template, but after the upgrade the depend condition is not truthy, so nothing is rendered.

If I change it to this, it works fine:

{{depend some_data}}<p>Some data: {{var some_data}}</p>{{/depend}}

My question is: is this some functionality that has been lost or broken in the upgrade to 1.9.2.1/1.14.2.1 from previous versions, deprecated and removed or just wrong to start with?

  • Old, yes, but I thought I should mention that it's clear that I'm setting "some_data" to the template parameters in that example, then trying to read it from the order model. It should still work, but the second example is reading it directly from the template parameters not from the order model – Robbie Averill Jun 24 '16 at 6:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.