0

I have created a custom module, In which I am sending email to customer. email is working fine but I have created a layout handle in layout/test.xml

<?xml version="1.0"?>
<layout version="0.1.0">
    <my_name_is_hello>
        <block type="core/template" name="hello"  template="test/sales/items.phtml"></block>
    </my_name_is_hello>
</layout>

This is my content in test/sales/items.phtml

<h1>Hello</h1>

Now I have called layout handle in my email template file hello.phtml using both method but file is not getting called.

{{layout handle="my_name_is_hello"}}
{{block type='core/template' area='frontend' template='test/sales/items.phtml'}}

Please can anybody suggest me if I am doing something wrong or any solution

1

2 Answers 2

0

First add the layout of the block in sales.xml in layout section file.

<my_name_is_hello>
    <block type="core/template" name="hello"  template="test/sales/items.phtml"></block>
</my_name_is_hello>

Than after use the below line in the email template

 {{layout handle="my_name_is_hello"}}
0
0

in your config.xml add this :

<global>
    ...
     <template>
         <email>
             <yourRooter_email_email_template translate="label" module="your module">
                 <label>custom email</label>
                 <file>custom_email.html</file>
                 <type>text</type>
             </yourRooter_email_email_template>
         </email>
     </template>
    ...
</global>

Then go to : app/locale/language_ISO/template/email/custom_email.html then add your block:

{{block type='core/template' area='frontend' template='test/sales/items.phtml'}}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.