Try the Demo

Magento Forum

   
[HOWTO]Call Model function within email template
 
Kresha7
Member
 
Total Posts:  51
Joined:  2011-09-13
 

Hello everyone, I have a question regarding email templates how can I load a collection from my custom controller within the email template.

How can I call this function for example:

print Mage::getModel('superproduct/superproduct')->superProductsList()

Magento has a lot of their own functions like

{{var order.getShippingAddress().format('html')}}
this is what I need to acomplish too. I have a function that returns a collection in html format. But how do I call that function within my new order template?

Thanks for any kind of help in advanced.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ryan Sun _Kuafu
Guru
 
Total Posts:  316
Joined:  2008-11-14
FL
 

You need to pass the object to mailer and then you can just call methods like

{{var object.method()}}

in transactional emails

 
Magento Community Magento Community
Magento Community
Magento Community
 
Kresha7
Member
 
Total Posts:  51
Joined:  2011-09-13
 

And how do I pass the object to the mailer ?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top