2021-06-23 13:27:39 +00:00
|
|
|
|
===============
|
|
|
|
|
|
Email Templates
|
|
|
|
|
|
===============
|
|
|
|
|
|
|
|
|
|
|
|
We all know writing good emails is vital to get a high response rate, but you do not want to
|
|
|
|
|
|
rewrite the same structure every time, do you? That is where email templates come in.
|
|
|
|
|
|
Without the need to rewrite the entire email structure every time, you save time to focus on
|
|
|
|
|
|
the content. Multiple templates also let you deliver the right message to the right audience,
|
|
|
|
|
|
improving their overall experience with the company.
|
|
|
|
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
The email templates use QWeb. The composer allows you to edit emails in their final rendering,
|
2022-11-18 10:10:48 +00:00
|
|
|
|
making customizations more robust as you don’t have to edit code.
|
2021-06-23 13:27:39 +00:00
|
|
|
|
|
|
|
|
|
|
Defining a default reply to on your mail template
|
2023-02-13 15:50:13 +00:00
|
|
|
|
=================================================
|
2021-06-23 13:27:39 +00:00
|
|
|
|
|
2022-11-18 10:10:48 +00:00
|
|
|
|
Although the field *reply to* is available within the mail templates, **this field is only used
|
|
|
|
|
|
for mass mailing** mode (this means when sending templates on what we call bulk emailing). You
|
|
|
|
|
|
can send emails in bulk in almost every app that has a list view. Select the records you want
|
|
|
|
|
|
and click on the action button. If you have an option to send an email, you will see a mail
|
2021-06-23 13:27:39 +00:00
|
|
|
|
composer with possible values to define:
|
|
|
|
|
|
|
|
|
|
|
|
.. image:: email_template/composer-mass-mailing-quotations.png
|
|
|
|
|
|
:align: center
|
|
|
|
|
|
:alt: Composer in mass mailing mode after selecting multiple quotations.
|
|
|
|
|
|
|
|
|
|
|
|
You can also define them by default on the template:
|
|
|
|
|
|
|
|
|
|
|
|
.. image:: email_template/reply-to-template-sales.png
|
|
|
|
|
|
:align: center
|
|
|
|
|
|
:alt: Reply-to field on template.
|
|
|
|
|
|
|
2022-11-18 10:10:48 +00:00
|
|
|
|
Because of this, setting a value in this field is useless as the value defined will be totally
|
|
|
|
|
|
ignored. The default *reply-to* value is the default catchall email address to ensure a
|
2021-06-23 13:27:39 +00:00
|
|
|
|
communication between your customer and your Odoo database. For more information about the way
|
|
|
|
|
|
the catchall works, please check :ref:`how to manage inbound messages <email_communication/inbound_messages>`.
|
|
|
|
|
|
|
2022-11-18 10:10:48 +00:00
|
|
|
|
Transactional emails and corresponding URL for each company
|
2023-02-13 15:50:13 +00:00
|
|
|
|
===========================================================
|
2021-06-23 13:27:39 +00:00
|
|
|
|
|
|
|
|
|
|
When using Odoo, multiple events trigger the sending of automated emails. These emails are known
|
|
|
|
|
|
as transactional emails and sometimes contain links pointing to your Odoo database.
|
|
|
|
|
|
|
|
|
|
|
|
By default, links generated by the database use the dynamic web.base.url key defined in the system
|
2022-03-02 10:19:33 +00:00
|
|
|
|
parameters. More information about this :ref:`parameter <domain-name/web-base-url>`.
|
2021-06-23 13:27:39 +00:00
|
|
|
|
|
2022-11-18 10:10:48 +00:00
|
|
|
|
If the website application isn't installed, the web.base.url key will always be the default
|
2021-06-23 13:27:39 +00:00
|
|
|
|
parameter used to generate all the links.
|
|
|
|
|
|
|
2022-11-18 10:10:48 +00:00
|
|
|
|
It’s important to know that this key can only have a single value, meaning that in a
|
|
|
|
|
|
multi-website/company database environment, even if you have a specific domain name for each
|
2021-06-23 13:27:39 +00:00
|
|
|
|
website, the links generated to share a document or within a transactional email might remain the
|
|
|
|
|
|
same, whatever the website/company related to the sending of the email/document.
|
|
|
|
|
|
|
2022-11-18 10:10:48 +00:00
|
|
|
|
This is not always the case as some Odoo applications have a link established in the database with
|
|
|
|
|
|
the website application, meaning that in this case, if a specific domain is defined for the
|
2021-06-23 13:27:39 +00:00
|
|
|
|
websites, the URL generated in the email template will use the domain defined on the corresponding
|
|
|
|
|
|
website of the company.
|
|
|
|
|
|
|
|
|
|
|
|
.. caution::
|
2022-11-18 10:10:48 +00:00
|
|
|
|
A document shared using the documents application will always use the web.base.url key, as the
|
|
|
|
|
|
document shared isn't associated with any particular website. Meaning that the URL will always be
|
|
|
|
|
|
the same (the web.base.url key value), whatever the company it's shared from, this is a known
|
2021-06-23 13:27:39 +00:00
|
|
|
|
limitation!
|
|
|
|
|
|
|
2022-11-18 10:10:48 +00:00
|
|
|
|
On the other hand, sales orders made by a customer on one of your Odoo e-commerce websites have a
|
|
|
|
|
|
link established with the website from which the order was made. As a result, the e-mail sent for
|
2021-06-23 13:27:39 +00:00
|
|
|
|
the sales orders uses the domain name defined for the corresponding website to generate the links.
|
|
|
|
|
|
|
2022-11-18 10:10:48 +00:00
|
|
|
|
For more information about how to configure your domains, we invite you to check :doc:`our domain name
|
2022-03-02 10:19:33 +00:00
|
|
|
|
documentation </administration/maintain/domain_names>`.
|
2021-06-23 13:27:39 +00:00
|
|
|
|
|
|
|
|
|
|
Updating translations within email templates
|
2023-02-13 15:50:13 +00:00
|
|
|
|
--------------------------------------------
|
2021-06-23 13:27:39 +00:00
|
|
|
|
|
2022-11-18 10:10:48 +00:00
|
|
|
|
Email templates are automatically translated. Changing the translations shouldn’t be necessary.
|
2021-06-23 13:27:39 +00:00
|
|
|
|
However, if for a specific reason you’d like to change some of the translations, this can be done.
|
|
|
|
|
|
|
|
|
|
|
|
Like any modification in the code, keep in mind that modifications that aren’t done correctly (for
|
|
|
|
|
|
example modifications leading to bad syntax) can break the template, as a result, the template
|
|
|
|
|
|
will appear blank.
|
|
|
|
|
|
|
|
|
|
|
|
In order to edit your translations, follow these steps from the template.
|
|
|
|
|
|
|
|
|
|
|
|
#. Click on the edit button, then on the language button
|
|
|
|
|
|
|
|
|
|
|
|
.. image:: email_template/edit-language-template.png
|
|
|
|
|
|
:align: left
|
|
|
|
|
|
:alt: Edit the language of a template
|
|
|
|
|
|
|
2022-11-18 10:10:48 +00:00
|
|
|
|
#. A pop-up window with the different languages installed on the database will be displayed. From
|
2021-06-23 13:27:39 +00:00
|
|
|
|
here, editing the translations will be possible. Don't forget to hit the save button to preserve
|
|
|
|
|
|
your changes.
|
|
|
|
|
|
|
|
|
|
|
|
.. image:: email_template/translation-body.png
|
|
|
|
|
|
:align: left
|
|
|
|
|
|
:alt: Translation of the body of the Application template in the different languages installed.
|