I had this issue:
I have created a custom mail where I send a list of products.
For this in my controller i concatenated a variable like this:
foreach (.....){
$orderItems .= "<tr>
<td>
<p>" . $productSku . "</p>
<p>" . $differanceQty . "</p>
</td>
</tr>";
}
When I tried to send this variable from my controller to the email template in my email I received the HTML code instead of only the value.
So my custom email doesn't interpret my variable in the right way.
So I started looking for an answer and I didn't find anything related to this issue so that's why I posted this, maybe this will help someone.
the solution is to use the variable like this in the mail :
{{var order}}
insead of {{htmlescape var=$order}}
Best Answer
The reason why you can get the variable
{{var order}}
is because you have the possibility tosetTemplateParams()
where you specify an array with params. This can be seen inMage_Core_Model_Email_Template_Mailer:147
Then the class
core/email_template
sends the array of params via its methodsendTransactional()
and that is why the custom variables are working for you.