도움말

How can I override email template without changing original template file.

Closed
Avatar
Alexander

The question has been closed

작성자
Sudhir Arya (ERP Harbor Consulting Services)
작성일 2013년 06월 13일 16시 40분 04초

How can I override email template?

In my case, I need to change invitation email template. I'm found set_password_email view in auth_signup module, but I want to keep originaly file. Template is not contain <field name="arch" type="xml"> section:

        <!-- Email template for new users -->
        <record id="set_password_email" model="email.template">
            <field name="name">OpenERP Enterprise Connection</field>
            <field name="model_id" ref="base.model_res_users"/>
            <field name="email_from"><![CDATA[${object.company_id.name} <${object.company_id.email}>]]></field>
            <field name="email_to">${object.email}</field>
            <field name="subject"><![CDATA[${object.company_id.name} invitation to connect on OpenERP]]></field>
            <field name="body_html">
                <![CDATA[
                    <p>
                        ${object.name},
                    </p>
                    <p>
                        You have been invited to connect to "${object.company_id.name}" in order to get access to your documents in OpenERP.
                    </p>
                    <p>
                        To accept the invitation, click on the following link:
                    </p>
                    <ul>
                        <li><a href="${object.signup_url}">Accept invitation to "${object.company_id.name}"</a></li>
                    </ul>
                    <p>
                        Thanks,
                    </p>
                    <pre>
--
${object.company_id.name or ''}
${object.company_id.email or ''}
${object.company_id.phone or ''}
                    </pre>
                ]]>
            </field>
        </record>
Avatar
Discard
1 응답
5

You just need to overwrite the record id of xml file.

Like this:

    <record id="auth_signup.reset_password_email" model="email.template">
        <field name="name">Reset Password Custom Name</field>
    </record>

Here I have changed value of name field only. You can also change any value as per your wish.

3 의견
Avatar
Discard
Avatar
Aron Lorincz
-

I'm wondering why it does not work. It should.

Avatar
Aron Lorincz
-

it was because some built-in templates are wrapped in a noupdate=1 block in the XML file

Avatar
Virali
-

i need to change body content but not working for me.