Files
odoo_source/addons/mass_mailing
std-odoo cc012a0864 [IMP] mail, various: add email templates management levels
Purpose
=======

Purpose of this commit is to add a new group for the mail template designer.
Goal is to make roles clearer: managers edit templates, users use them. This
commit allow some designers / managers to make email template and to let
others users use those email templates.

Specifications
==============

When this feature is enabled in the Settings page, a new group is required to
modify email templates in a composer like wizard or to make dynamic content.
This allows to separate managers editing / composing templates from standard
users that use them.

If the current does not have this group, the email body will be in readonly
mode if he selected an email template. That way we force him to use the email
template that the manager made.

Technical
=========

New Group
---------

Only users in this group will be able to create / write email template or
to write Jinja code in the mail composer (including other fields like subject
in mailing).

By default, all internal users have this group. Mass mailing users also have
this group as writing mailings is about the same management level as writing
templates.

Mail Composer Mixin
-------------------

In comment mode, the template is rendered and then saved on the body field
so non-"Mail Template Editor" users can load email templates.

But in mass mode, the body of the template is saved and then rendered and
many things change the body (HTML sanitizer, web editor move inline CSS
properties, add / remove spaces...). So in this case, we can not know if
the user changed the body or not. That is why we put the body field in
readonly mode so, it is not modified by the web editor.

Jinja code detection
--------------------

To detect dynamic Jinja content, we compile the template, and we browse the
AST. If we do not have a single "Template Data" node, we assume that the
template is dynamic.

When we detect the template as static, we do not render it. That way we
avoid unnecessary rendering.

Code cleaning
-------------

Move Jinja import into tools so that it is outside of mail framework code.

Task-2187263

closes odoo/odoo#75840

Related: odoo/enterprise#20547
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-09-02 03:42:54 +00:00
..
…

Odoo Mass Mailing

Easily send mass mailing to your leads, opportunities or customers with Odoo Email Marketing. Track marketing campaigns performance to improve conversion rates. Design professional emails and reuse templates in a few clicks.

Send Professional Emails

Import database of prospects or filter on existing leads, opportunities and customers in just a few clicks.

Define email templates to reuse content or specific design for your newsletter. Setup several email servers with their own IP/domain to optimise opening rates.

Organize Marketing Campaigns

Design, Send, Track by Campaigns with our Lead Automation app.

Get real time statistics on campaigns performance to improve your conversion rate. Track mails sent, received, opened and answered.

Easily manage your marketing campaigns, discussion groups, leads and opportunities in one simple and powerful platform.

Integrated with Odoo Apps

Get access to mass mailing features from every Odoo app to improve the way your users communicate.

Send template of emails from Odoo CRM opportunities, select leads based on marketing segments, send job offers and automate answers to applicants, reuse email template in the lead automation marketing campaigns.

Answers to your emails appears automatically in the history of every document with the social network module.

Clean Your Lead Database

Get a clean lead database that improves over the time using the performance of your mails. Odoo handle bounce mails efficiently, flag erroneous leads accordingly and gives you statistics on the quality of your leads.

One click emails send

The marketing department will love working on campaigns. But you can also give a one click mass mailing facility to all others users on their own prospects or documents.

Select a few documents (e.g. leads, support tickets, suppliers, applicants, ...) and send emails to their contacts in one click, reusing existing emails templates.

Follow-up On Answers

The chatter feature enables you to communicate faster and more efficiently with your customer. Get documents created automatically (leads, opportunities, tasks, ...) based on answers to your mass mailing campaigns Follow the discussion directly on the business documents within Odoo or via email.

Get all the negotiations and discussions attached to the right document and relevent managers notified on specific events.

Campaigns Dashboard

Get the insights you need to make smarter marketing campaign. Track statistics per campaign: bounce rates, sent mails, best content, etc. The clear dashboards gives you a direct overview of your campaign performance.

Fully Integrated With Others Apps

Define automated actions (e.g. ask a salesperson to call, send an email, ...) based on triggers (no activity since 20 days, answered a promotional email, etc.)

Optimize campaigns from lead to close, on every channel. Make smarter decisions about where to invest and show the impact of your marketing activities on your company's bottom line.

Integrate a contact form in your website easily. Forms submissions create leads automatically in Odoo CRM. Leads can be used in marketing campaigns.

Manage your sales funnel with no effort. Attract leads, follow-up on phone calls and meetings. Analyse the quality of your leads to make informed decisions and save time by integrating emails directly into the application.