Files
odoo_source/addons/mass_mailing
Thibault Delavallée 9345060498 [IMP] mail: respect alias domains in 'mail.mail' and outgoing emails
PURPOSE

Allow alias domains to be multiple, notably to be used in a multi company
environment where each company has its own alias domain.

SPECIFICATIONS: MAIL.MAIL

Update MailMail to use alias domains. Notably "Return-Path" headers are
now computed based on alias domain when possible, using the recently added
fields on 'mail.message' model for that purpose. Fallback is to use current
company's bounce email when mail_mail creation is done outside of classic
mail flows or without that information.

SPECIFICATIONS: IR.MAIL.SERVER

Update IrMailServer and low-level stack to use alias domains. This has an
impact notably on default values computation for from and bounce emails

  * '_get_default_bounce_address' is called when there is no 'Return-Path'
    given. Most classic mail flows will set it according to current record
    company / alias domain. Fallback when not set is to fallback on current
    company's bounce email, computed based on its alias domain;
  * '_get_default_from_address' is used in two use cases
    * computing a default 'email_from' for outgoing emails when it is not set.
      In most classic mail flows it is set based on current user's email. If
      not set fallback on current company's notification emails is considered
      as a safe bet, replacing the global configuration parameter;
    * overriding the 'email_from' of emails that are considered spoofing the
      mail server, allowing to wrap the sending into a 'notifications@domain'
      generic sender. For those we should try to keep record's information as
      it may be called in classic mail flows;
  * '_get_default_from_filter' is added in base and overridden in mail to
    either use 'mail.default.from_filter' ICP, or use the one defined on
    the alias domain. Supporting both is still an option, as its behavior
    is implemented for basic email sending, without mail being available.

Those methods are updated to try to support multi domains / multi company
setup. However as those defaults are located ar ir.mail_server level it is
not always easy to have complete environment information, hence fallbacking
on current company's parameters when no better information is provided.

A test about 'mail.default.from' is removed, as it was testing a default_from
outside of catchall domain. It is not possible anymore as default_from is now
part of domain definition. As multi domains is supported, no need to support
exotic configuration like that.

SPECIFICATIONS: FROM MAIL.MAIL TO OUTGOING EMAILS

When sending emails based on MailMail, we now prepares sending groups based
on MailServer, email_from, but also alias domain to which the mail belongs to.
Information about alias domain (e.g. notifications email based on default_from
and bounce email) is propagated to low-level email preparation methods. It
uses the context as it is the easiest way to propagate information to that
level without hacking too much models or calls.

Task-36879 (Mail: Support Multi Domains Aliases)

Part-of: odoo/odoo#76734
2023-10-24 19:24:50 +00:00
..
…
…
2023-10-20 11:22:05 +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 automation rules (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.