I am using Magento 1.9.3.7 version. I am triggering a mail from the observer with multidimensional array values. How I can get and use it in the mail template.
1 Answer
We should include a block with the template from a current theme inside the email template instead, just like we do for CMS pages. See below:
{{block type='core/template' area='frontend' template='pathtotemplate/templatefilename.phtml' items=$items}}
Then, you just need to sort out your data in phtml-file, see the following example:
<?php foreach ($this->getItems() as $_item): ?>
<p><?php echo $_item['name'] ?></p>
I referred this link for the solution.
-
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From ReviewManoj Deswal– Manoj Deswal2018-02-26 06:38:38 +00:00Commented Feb 26, 2018 at 6:38
-
1@ManojDeswal Thanks for the comments. I changed the Answer.Saravanan DS– Saravanan DS2018-02-26 07:51:39 +00:00Commented Feb 26, 2018 at 7:51