Sunday, 6 April 2014

Magento AW Followupemail extension : Show multiple products in email template.


As I discussed in my previous post, due to well-written documentation it was very easy to integrate AW Followupemail extension. I implemented the basic functionality using newsletter templates and it is working very fine. But, there was a confusion in Product Review follow-up email, in case there will be having more than one products in cart. I mean to say I have to loop through the cart items. Let’s do it.

1) Go to Admin Section -> Newsletter->Newsletter Templates

2) Create a Newsletter template with name ‘AW Product Feedback’ and copy following code in Template Content section.

<h1>Dear {{var customer_name}}!</h1>

<p> You have bought these products on {{var order.updated_at|formatDateTime:F j, Y}}</p>

<p>The order contains the following items:</p>

<table border="1" cellspacing="1" cellpadding="5" width="100%">
    <tbody>
        <tr>
            <th>No</th> <th>Product</th> <th>Image</th> <th>Leave a Review</th>
        </tr>
        {{foreach var="$order.getAllVisibleItems()" template="nsltr:AW Review Product Row"}}       
    </tbody>
</table>

<p>Thanks !</p>
<p><a href="{{store url=""}}">{{store url=""}}</a></p>

3) Create another Newsletter template with name ‘AW Review Product Row’ and copy following code in Template Content section.

<tr>
                 
                 <td>{{var row_item_row_number}}</td>
                 
                  <td><a href="{{store url="catalog/product/view" 
                 id="$row_item.product.id"}}">{{var  row_item.name}}</a></td>
                  
                  <td align="center"><img src="{{thumbnail size="75" 
                 source="row_item.product"}}"/></td>
                  
                   <td align="center"><a href="{{store url="review/product/list" 
                  id="$row_item.product.id"}}">Leave a Review</a></td>

</tr>

That’s it and in follow-up email it will show all the products which were there in the ordered cart. While implementing this please keep in mind following points as well.

Important :
1) Newsletter Templates must be of ‘text’ type not ‘html’ type.

2) In first template we have mentioned following line : template="nsltr:AW Review Product Row"

nsltr : means template will be of newsletter type.
 AW Review Product Row : is name of the other template.

If you need any other help regarding this topic please feel free to comment.


Thanks!!!!!!!! Enjoy Programming :)


2 comments:

  1. This was a massive help to find how to alter email marketing for follow up emails. Thanks!

    ReplyDelete

Thanks for your valuable comments.

Odoo 10: Close wizard and open standard form

Hi, Today we are going to learn how to open standard form after saving data in wizard. Let's say I have created an wizard to fill bas...