Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Use of block in transactional email
 
grabbi
Jr. Member
 
Total Posts:  7
Joined:  2011-06-06
 

Hi,

in a transactional email I’m using a template block like this:

{{block type=’core/template’
area=’frontend’
template=’/email/myblock.phtml’
order=$order}}

But it is not possible to put the block’s code into my package/theme directory, Magento does not find. It is found and used only when i put it into

/app/design/frontend/base/default/template/email

What can I do to make Magento search my package/theme directory when using a block in a transactional mail?

Thanks
grabbi

 
Magento Community Magento Community
Magento Community
Magento Community
 
Siggi_Schmitz
Enthusiast
 
Avatar
Total Posts:  811
Joined:  2011-07-03
 

But normally, your own package / theme is loaded, right?

 
Magento Community Magento Community
Magento Community
Magento Community
 
grabbi
Jr. Member
 
Total Posts:  7
Joined:  2011-06-06
 

Yes, everything works fine except this email problem.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Siggi_Schmitz
Enthusiast
 
Avatar
Total Posts:  811
Joined:  2011-07-03
 

Hmmm, don´t know why it`s not working, but you can use the absolute path to the template file, it`s not a clean solution but it will work.

 
Magento Community Magento Community
Magento Community
Magento Community
 
tzyganu
Mentor
 
Avatar
Total Posts:  2205
Joined:  2009-11-18
Bucharest, Romania
 

Hello
Try it like this.
in one of your layout xml files add this:

<email_handle><!-- name this what ever you want but make sure it doesn't exist -->
        <block type="core/template" name="email_handle" template="email/myblock.phtml" />
    </email_handle>
In your email template file add this (replace email_handle with the tag from above if you change it):
{{layout handle="email_handle" order=$order}}

Let me know if it works.

Marius.

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