Email templates

Email templates are saved emails that are used repeatedly to send emails from the database. They allow users to send quality communications, without having to compose the same text repeatedly.

Creating different templates that are tailored to specific situations lets users choose the right message for the right audience. This increases the quality of the message and the overall engagement rate with the customer.

Note

Email templates in Odoo use QWeb or XML, which allows for editing emails in their final rendering, making customizations more robust, without having to edit any code whatsoever. This means that Odoo can use a Graphical User Interface (GUI) to edit emails, which edits the backend code. When the received email is read by the end user’s program, different formatting and graphics will appear in the final form of it.

Access email templates in developer mode by navigating to Settings app ‣ Technical menu ‣ Email ‣ Email Templates.

Editing email templates

The powerbox feature can be used when working with email templates. This feature provides the ability to directly edit the formatting and text in an email template, as well as the ability to add links, buttons, or images.

Additionally, the XML/HTML code of the email template can be edited directly, via the </> icon. Dynamic placeholders (referencing fields within Odoo) are also available for use in the email template.

Powerbox

The powerbox feature is an enriched text editor with various formatting, layout, and text options. It can also be used to add XML/HTML features in an email template. The powerbox feature is activated by typing a forward slash / in the body of the email template.

When a forward slash / is typed in the body of an email template, a drop-down menu appears with the following options:

Structure

  • Bulleted list: Create a simple bulleted list.

  • Numbered list: Create a list with numbering.

  • Checklist: Track tasks with a checklist.

  • Table: Insert a table.

  • Separator: Insert a horizontal rule separator.

  • Quote: Add a blockquote section.

  • Code: Add a code section.

  • 2 columns: Convert into two columns.

  • 3 columns: Convert into three columns.

  • 4 columns: Convert into four columns.

Format

  • Heading 1: Big section heading.

  • Heading 2: Medium section heading.

  • Heading 3: Small section heading.

  • Switch direction: Switch the text’s direction.

  • Text: Paragraph block.

Media

  • Image: Insert an image.

Navigation

  • Link: Add a link.

  • Button: Add a button.

Widgets

  • 3 Stars: Insert a rating over three stars.

  • 5 Stars: Insert a rating over five stars.

Basic Blocks

  • Signature: Insert your signature.

Marketing Tools

  • Dynamic Placeholders: Insert personalized content.

Tip

To use any of these options, click on the desired feature from the powerbox drop-down menu. To format existing text with a text-related option (e.g. Heading 1, Switch direction, etc.), highlight the text, then type in the activator key (forward slash) /, and select the desired option from the drop-down menu.

screenshot: general-email-template-powerbox
menu
Settings ‣ Technical ‣ Email ‣ Email Templates ‣ (a template)
shows
Body of an email template with "/" typed and the powerbox command list open (Structure, Format, Media, Navigation, …).
highlight
The powerbox list.
data
Template "Sales: Send Quotation".
module
mail
notes
English UI, developer mode active, crop to the relevant area.

XML/HTML code editor

To access the XML/HTML editor for an email template, first enter developer mode. Then, click the </> icon in the upper-right corner of the template, and proceed to edit the XML/HTML. To return to the standard text editor, click the </> icon again.

screenshot: general-email-template-code-editor
menu
Settings ‣ Technical ‣ Email ‣ Email Templates ‣ (a template)
shows
The Content tab of the template in code view (after clicking the </> icon), showing the XML/HTML source of the body.
highlight
The </> icon.
data
Template "Sales: Send Quotation".
module
mail
notes
English UI, developer mode active, crop to the relevant area.

Warning

The XML/HTML editor should be accessed with caution as this is the backend code of the template. Editing the code can cause the email template to break immediately or when upgrading the database.

Dynamic placeholders

Dynamic placeholders reference certain fields within the Odoo database to produce unique data in the email template.

Example

Many companies like to customize their emails with a personalized piece of customer information to grab attention. This can be accomplished in Odoo by referencing a field within a model by inserting a dynamic placeholder. For example, a customer’s name can be referenced in the email from the Customer field on the Sales Order model. The dynamic placeholder for this field is: {{ object.partner_id }}.

Dynamic placeholders are encoded to display fields from within the database. Dynamic placeholders can be used in the Body (Content Tab) of the email template. They can also be used in the fields present in the Email Configuration tab, the Subject of the email, and the Language.

To use the dynamic placeholders in the Body of an email open the powerbox feature by typing in / into the body of the email template under the Content tab. Scroll to the bottom of the options list, to Marketing Tools. Next, select Dynamic Placeholder. Then select the dynamic placeholder from a list of available options and follow the prompts to configure it with the desired corresponding Odoo field. Each dynamic placeholder will vary in configuration.

screenshot: general-email-template-dynamic-placeholder
menu
Settings ‣ Technical ‣ Email ‣ Email Templates ‣ (a template)
shows
Body of a template with "/field" typed; the dynamic placeholder popover lets the user choose a field (e.g., Customer > Name) and a default value.
highlight
The dynamic placeholder popover.
data
Template "Sales: Send Quotation".
module
mail
notes
English UI, developer mode active, crop to the relevant area.

Note

Each unique combination of Fields, Sub-models and Sub-fields creates a different dynamic placeholder. Imagine it as a combination to the field that is being created.

To search the available fields, simply type in the front-end name (on user-interface) of the field in the search. This will find a result from all of the available fields for the model that the email template is created for.

Warning

Customizing email templates are out of the scope of Odoo Support.

Rich text editor

A rich text editor toolbar can be accessed by highlighting text in the email template. This can be used to change the heading, font size/style, color, add a list type, or a link.

screenshot: general-email-template-toolbar
menu
Settings ‣ Technical ‣ Email ‣ Email Templates ‣ (a template)
shows
Text selected in the template body with the rich text editor toolbar displayed above it.
highlight
The toolbar.
data
Template "Sales: Send Quotation".
module
mail
notes
English UI, developer mode active, crop to the relevant area.

Resetting email templates

Should the email template not work because the code has been altered it can be reset to restore it back to the out-of-box default template. Simply click on the Reset Template button in the upper left-hand of the screen and the template will be reset.

screenshot: general-email-template-reset
menu
Settings ‣ Technical ‣ Email ‣ Email Templates ‣ (a template)
shows
Top of an email template form with the "Reset Template" button.
highlight
The "Reset Template" button.
data
Template "Sales: Send Quotation".
module
mail
notes
English UI, developer mode active, crop to the relevant area.

Default reply on email templates

Under the Email Configuration tab on an email template, there is a Reply To field. In this field, add email addresses to which replies are redirected when sending emails en masse using this template.

Tip

Add multiple email addresses by adding a comma , between the addresses or dynamic placeholders.

screenshot: general-email-template-reply-to
menu
Settings ‣ Technical ‣ Email ‣ Email Templates ‣ (a template)
shows
The Email Configuration tab of a sales template with the "Reply To" field filled with an address.
highlight
The "Reply To" field.
data
Template "Sales: Send Quotation".
module
mail
notes
English UI, developer mode active, crop to the relevant area.

The Reply To field is only used for mass mailing (sending emails in bulk). Bulk emails can be sent in almost every Odoo application that has a list view option.

To send mass mails, while in list view, check the boxes next to the desired records where the emails are to be sent, click the Action button (represented by a ⚙️ (gear) icon), and select the desired email option from the Action drop-down menu. Email options can vary by the particular list view and application.

If it is possible to send an email, a mail composer pop-up window appears, with values that can be defined and customized. This option will be available on the Action button on pages where emails can be sent in bulk—for example, on the Customers page of the CRM app. This action occurs throughout the Odoo database.

screenshot: general-email-template-composer-mass
menu
Contacts ‣ List view ‣ select records ‣ Actions ‣ Send email
shows
Email composer opened from a list with several records selected (mass mailing mode), showing the "Replies" option and the "Reply-to" address.
highlight
The reply-to options.
data
Three demo customers selected.
module
mail
notes
English UI, developer mode active, crop to the relevant area.

Cc and Bcc on email templates

In the Email Configuration tab of an email template, the Cc field contains the comma-separated addresses that receive a carbon copy of the emails sent with the template.

With the Email CC and BCC module (mail_composer_cc_bcc), a Bcc field is added under it, for blind carbon copy recipients, and default Cc and Bcc contacts can be set on the company. See Cc and Bcc recipients.

Note

Both fields are hidden when Default recipients is enabled on the template.

Transactional emails and corresponding URLs

In Odoo, multiple events can trigger the sending of automated emails. These emails are known as transactional emails, and sometimes contain links redirecting to the Odoo database.

By default, links generated by the database use the dynamic web.base.url key defined in the system parameters. For more information about this, see system parameters.

If the Website application is not installed, the web.base.url key will always be the default parameter used to generate all the links.

Important

The web.base.url key can only have a single value, meaning that, in a multi-website or multi-company database environment, even if there is a specific domain name for each website, the links generated to share a document (or the links within a transactional email) may remain the same, regardless of which website/company is related to the sending of the email/document.

Example

If the Value of the web.base.url system parameter is equal to https://www.mycompany.com and there are two separate companies in Odoo with different website URLs: https://www.mycompany2.com and https://www.mycompany1.com, the links created by Odoo to share a document, or send a transactional email, come from the domain: https://www.mycompany.com, regardless of which company sends the document or email.

This is not always the case, as some Odoo applications (eCommerce, for example) have a link established in the database with the Website application. In that case, if a specific domain is defined for the website, the URL generated in the email template uses the domain defined on the corresponding website of the company.

Example

When a customer makes a purchase on an Odoo eCommerce website, the order has an established link with that website. As a result, the links in the confirmation email sent to the customer use the domain name for that specific website.

For more information about how to configure domains, check out the domain name documentation.

Updating translations within email templates

In Odoo, email templates are automatically translated for all users in the database for all of the languages installed. Changing the translations shouldn’t be necessary. However, if for a specific reason, some of the translations need to be changed, it can be done.

Warning

Like any modification in the code, if translation changes are not done correctly (for example, modifications leading to bad syntax), it can break the template, and as a result, the template will appear blank.

In order to edit translations, first enter developer mode. Then, open the email template, and click on the language button, represented by the initials of the language currently being used (e.g. EN for English).

screenshot: general-email-template-language-button
menu
Settings ‣ Technical ‣ Email ‣ Email Templates ‣ (a template)
shows
Template form with the language button (e.g., "EN") of the Subject or body field clicked.
highlight
The language button.
data
Template "Sales: Send Quotation".
module
mail
notes
English UI, developer mode active, crop to the relevant area.

Note

If there aren’t multiple languages installed and activated in the database, or if the user does not have administration access rights, the language button will not appear.

A pop-up window with the different languages installed on the database appears. From this pop-up, editing of translations is possible. When the desired changes have been made, click the Save button to save the changes.

screenshot: general-email-template-translation-dialog
menu
Settings ‣ Technical ‣ Email ‣ Email Templates ‣ (a template)
shows
The translation dialog of a template body listing the installed languages with their translated values; the default language is in bold.
highlight
The default language line.
data
Languages English and Hungarian installed.
module
mail
notes
English UI, developer mode active, crop to the relevant area.

Note

When editing the translations, the default language set in the database appears in bold.