Read More
Read More
Menu Close

    Magento Collection Iteration in Email Template

    In this blog i’ll discuss about how to iterate(using foreach loop) the Collection in your custom email templates.

    Let’s think situations like when you have to send an email which contains multiple customer addresses or product items, then you must need to iteration the collections in your custom email template.

    Magento provide very simple architecture to implement this feature in your project:

    Step 1: Add Below line in your email template

    template:- here you have to specify your custom phtml file path which should be kept inside magento frontend part.

    addresses:- it’s your Address collection which you want to iterate(using foreach loop) in your phtml file.

    Searching for an experienced
    Magento Company ?
    Read More

    PHTML Path:- app/design/frontend/default/default/template/yourmodule

    Now you can easily fetch your $addresses inside your phtml file like below:

    Now It’s done you’re ready to send the email with multiple addresses.

    I Hope this blog will help someone who needs above feature.



    . . .
    Discuss on Helpdesk

    Leave a Comment

    Your email address will not be published. Required fields are marked*


  • Akshay Taru
    Hi, I have tried exactly the same, But it is not working. My block not able to find the for loop template. Please help.
  • Back to Top