How to Get Current Custom Transactional Email Template ID

email-templatestransactional

I'm making some changes on the following file:
app/design/frontend/base/default/template/email/order/items/order/default.phtml

and what I need is to check if there's a custom trasactional email template used, and if it is, I'd like to get it's ID.
(System > Transactional Emails)

I have no idea how to do this! Could you please help me?

EDIT : SOLUTION
(based on Marius suggestions)

In file addp/design/frontend/base/default/layout/sales.xml, after <sales_email_order_items>...</sales_email_order_items>
I added the following code

<sales_email_order_items_dupl>
    <block type="sales/order_email_items" name="items" template="email/order/items.phtml">
        <action method="addItemRender"><type>default</type><block>sales/order_email_items_order_default</block><template>email/order/items/order/default_duplicate.phtml</template></action>
        <action method="addItemRender"><type>grouped</type><block>sales/order_email_items_order_grouped</block><template>email/order/items/order/default_duplicate.phtml</template></action>
        <block type="sales/order_totals" name="order_totals" template="sales/order/totals.phtml">
            <action method="setLabelProperties"><value>colspan="3" align="right" style="padding:3px 9px"</value></action>
            <action method="setValueProperties"><value>align="right" style="padding:3px 9px"</value></action>
            <block type="tax/sales_order_tax" name="tax" template="tax/order/tax.phtml">
                <action method="setIsPlaneMode"><value>1</value></action>
            </block>
        </block>
    </block>
    <block type="core/text_list" name="additional.product.info" />
</sales_email_order_items_dupl>

Best Answer

The template is not aware of the email template that is calling it.
If your template needs to look differently based on the e-mail, you need to use 2 templates for 2 different emails.
I mean instead of using in both of them

 {{layout handle="some_handle_here"}}

in both of them, you need to use in the section one something like this:

 {{layout handle="some_other_handle_here"}}

and create the new layout handle in one of your layout files and use a different template file.

Related Topic