Odoo 9 Email Template

This is a basic email template to put in the xml file:

<record id="email_template" model="mail.template">
    <field name="name">My Email Template</field>
    <field name="email_from">no-reply@domain.com</field>
    <field name="subject">Email Template</field>
    <field name="partner_to">${object.address_home_id.id}</field>
    <field name="model_id" ref="module_name.model_model_name" />
    <field name="auto_delete" eval="True" />
    <field name="lang">${object.user_id.lang}</field>
    <field name="body_html"><![CDATA[<div>My email template</div>]]></field>
</record>

if the module name is abc and the model name is voyelle then module_name.model_model_name should be abc.model_voyelle.
${object} is the model ${object.name} will display the attribute name of the current model.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.