1

If I create a email template in System > Transactions Email what xml layout is used?

What is the block type here?

1 Answer 1

3

This questions is actually a bit too broad but I'd like to give some insights on that:

When you create a transaction e-mail template via the adminhtml section, the content of the corresponding mail template from app/locale/[language_country]/template/email/[filename].html is copied to the database.

As an example for the "New account" e-mail, the declaration can be found in app/code/core/Mage/Customer/etc/config.xml:

<template>
            <email>
                <customer_create_account_email_template translate="label" module="customer">
                    <label>New account</label>
                    <file>account_new.html</file>
                    <type>html</type>
                </customer_create_account_email_template>
                ...
            </email>
</template>

If the e-mail is being sent, the HTML-template is parsed and the variable and block directives ({{store url=""}}, {{layout handle="sales_email_order_items" order=$order}} from the order_new.html template,...) are then replaced by their corresponding blocks defined in the XML-files.

<sales_email_order_items> can be found in app/design/frontend/base/default/layout/sales.xml where also the block type (<block type="sales/order_email_items" ...> in this case) is defined.

The mail classes of Magento responsible for e-mail sending are Mage_Core_Model_Email_Templateand Mage_Core_Model_Email_Template_Filter.

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.