Email templates

< / / / / / >
Framework Email
V 13.0
+/- 5 minutes
Written by Yenthe Van Ginneken

Quick scroll

1. Introduction

Email templates are an often used feature in Odoo. They allow you to create pre-defined emails and you can add variables in the template that are parsed by Jinja2. If you have a process that needs to send an e-mail to the customer that always needs to have the same format then email templates are the way to go.

2. Configuration options

2.1 email_from

If the 'email_from' field is set it will override the author's email address. You usually use this option if you want that the email template being sent is always sent from the same address.


2.2 use_default_to

Defines the default recipients of your email. The email will be sent to the partner attached to the current record or the email being set in the email field.


2.3 email_to

Email addresses to which this email template is being sent. This field takes a comma-separated list of email addresses:


2.4 partner_to

The recipients to which this email template is being sent. This field takes a comma-separated list of ids for the contacts. This field can take Jinja2 expressions:


2.5 email_cc

Email addresses from people that have to be added in CC. This field takes a comma-separated list of email addresses:


This field can also take Jinja2 expressions:


2.6 reply_to

The preferred response address. If this field is not set it will take the email from the user that sends out the email. If set then the email set in this field will be used as reply to address:


This field can also take Jinja2 expressions:


2.7 lang

Defines in which language the email template should be sent. By default the email template is being sent in English. By setting a Jinja2 expression Odoo will automatically load the email in the language that is defined:


In this example the email template will be sent in the language of the partner his/her language.

2.8 mail_server_id

The preferred email server to send out the email with. If the field is not set Odoo will search the email server with the highest priority set. As this field is a Many2one to the model 'ir.mail_server' it is only safe to use this option if you've defined a mail template in XML and can reference to this ID:


2.9 auto_delete

If this boolean is set to True the email will automatically be deleted from your Odoo after it is being sent. This option can also be set to True to make sure that an email with sensitive data is not being shown in the chatter to internal users. For example if it contains a password or invitation link.


2.10 user_signature

If this field is set to True Odoo will automatically add the signature of the user at the end of the email template. If not set the signature is not being added on the email:


2.11 scheduled_date

The date on which this email should be sent out. If no date is set Odoo will automatically send out the email as soon as possible. This field takes a Jinja2 variable:

You need an account for this tutorial
Create a free account to access the tutorial.

Already a member? login here.