Purpose of this commit is to re-arrange mass mailing buttons and to add
a button for scheduling mass mailing in future :
* add schedule date in debug mode;
* re-arrange all button;
* add schedule in future button and on click open wizard to schedule future
date;
* on 'send now' button remove the useless '|' in domain;
* add a small wizard to select the send date;
This commit is related to task ID 46932
When sending the test email of a mass mailing campaign, it might be
observed that the result is different from the final email sent to
customers.
This is because the `body` field of the final mail message is an `Html`
field with options `sanitize_style=True` and `strip_classes=True`. On
the other hand, the `body_html` field the test mail is a simple `Text`
field which is not sanitized.
We sanitize the `body_html` field with similar options.
opw-1820064
Since notification emails are not mail templates anymore they do not go
through the mail_template.render_post_process() method that converts
local links to absolute links. This means that buttons and images were
not correctly displayed in notification emails. Indeed those still had
local links.
This commit fixes that by moving the method directly in mail.thread and
calling it accordingly when rendering the notification email. Note that
the method has been changed in order to use regex instead of html
parser. It is done based on work already done in mass mailing application.
Indeed using parsers is complex and time consuming and may create
changes in the html structure that are not intended.
Next step in master is to go through various link modifications in
mass mailing module to see how to handle them properly. Maybe.
Purpose
=======
Mailing lists are not flexible. It should be possible to merge mailing lists and remove duplicates when doing it.
Specification
=============
- When selecting records, in the action menu, add "Merge selected mailing lists"
- A modal will open :
- There's the choice between merging the contacts into a new mailing list or an existing one
- There's the choice to archive the source mailing lists or not
- The duplicates are avoided in the destination mailing list
- Opt-out contacts are not copied in the destination list
This commit removes the strange selection box based on a magic flag and
some strange methods returning a string. Instead just allow to send mass
mailing on all models inheriting from mail.thread using the is mail
thread flag.
Various addons are updated to remove the _mail_mass_mailing class
attribute used to determine mass mailing capability.
We consider people could send a mass mailing on every model inheriting
from mail.thread. It makes no sense to limit it to a given set of addons.
When you send a mass mailing to muiltiple partner, if some of them have
no email adresse, it can lead to errors because of the variable 'recips'
is not set if the first occurence in the 'for loop' has no email.
To fix this, we always set the variable 'recips' by replacing the 'elif'
close by a 'else' one
introduced in rev: https://github.com/odoo/odoo/commit/65ed4553a50fdbefc986b7d21f87a81c42b743c7
Before this commit, the filtering brought by commit ca989b6 did not work when
no email_to was present. Which is the case for mass-mailings based on
res.partner records.
OPW 728321
Closes#16745
The mass-mailing App suffered from severe issues due to its inability
to detect and handle duplicates "at the email level", and the absence
of any global blacklist system, leading to lack of user trust.
Mailing-lists typically include multiple records with the same email,
and it is critical to avoid sending them the same email several times.
A related problem is the unsubscription of an email that is present
in other records (duplicates). Opting out the first email should
automatically blacklist it for other records as well.
Ideally we should have a global blacklist table in order to
share the unsubscription requests globally across models (Leads,
Partners, Mailing-list contacts). It would also allow importing
it from other blacklist systems. (TODO for master)
This commit introduces a partial solution, made of several
small changes:
- In mail.mail: double-check that an outgoing email has the
correct status (`outgoing`) before sending it. This allows
adding emails in the queue and cancelling them before they
actually get sent.
- In crm.lead: force predictable recipients for mass-mailing,
by always using the email of the lead rather than the email
of the linked partner when there is one. This simplifies the
computation of the blacklist and seen list. Other areas in
the codebase already assume as much.
- In mass.mailing:
+ Before sending out a mailing-list batch, compute the
blacklist (all opted-out emails) and the seen_list
(emails who previously received this mail) to make
sure we only ever target valid recipients.
+ While delivering the mass-mailing, any email targeting
an address that is in the blacklist or "seen list" is
canceled before being sent. The corresponding statistics
entry is considered "not delivered".
Also updates the "seen list" continuously.
+ When a mass-mail belongs to a campaign with the
"unique AB/B testing" flag, the "seen list" is
common to the whole campaign, as an extra safety.
+ Auto-delete mass-mailing test messages sent with the
test wizard, to avoid polluting the mail_mail table
Note: this fix uses a simple regex for efficiently extracting
the blacklist in pure SQL from different models, and doing so,
assumes that each record only holds a single email
(no comma-separated adresses). This should be sufficient for
most cases. The regex:
([^ ,;<@]+@[^> ,;]+)
The test wizard will be dropped eventually but it is not possible to delete
the mass-mailing before the transient is cleaned too due to the required field.
To make it faster, add a ondelete cascade on the field.
Closes#15217
When using the "Test Mailing" button, a sample mail was sent to a
particular mail address and a text-like unsubscribe link was added
below the mail body. This link was ugly, ununderstandable and useless
as it is test mailing anyway.
To add unsubscribe links to your mail body, use the footer blocks
which contain this kind of link (note: they are inserted by default
in all mail templates).
When testing a mass mailing before sending the mailing
to the contacts (which well, is always the case),
the local links were not replaced by absolute links,
and the override done on the method `send_get_email_dict`
to convert the link `/unsubscribe_from_list` to the actual
unsubscription link was not working, as it relied
on the absolute link.
opw-657982
1. The merge of the "email_template" module into the "mail" module.
2. The send action of the mass mailing has been moved from the frontend to a cron, because it was too slow to send over 10,000 mails (the user's browser was blocked for 15 - 20 minutes). Mass mailings have now their own process in the kanban view.
3. Mails sent from the mail form are sent immediatly instead of from the mail queue (for instance, when you go to sales > customers > list view > select 2 -3 customers > More > Partner Mass Mailing).
4. Users have now the choice from which mailing list they want to unsubscribe when they click on the unsubscribe link at the bottom of the mail.
5. Mass mailings inherit from their campaign UTMs and mass mailing campaigns are linked to an UTM campaign.
6. Many little improvements
* [FIX] rename wrong mailing_type field and add missing fields when creating a mass mailing from the composer
* [FIX] coerce tooltip to an unicode string to avoid a json crash when locale produces a non unicode string for strftime(%B)
* [FIX] repair wrong sql statement computing statistics
- fixed keeping the original message for routing, only when choosing to reply in the
original thread (notification=True)
- auto delete sent emails explicitely
- mail_thread: routing: fixed replies always choosen even when replying to emails
with a specified reply_to (using ref_match in the algorithm)
- mail_thread: routing: instead of exclusive routing heuristics, use each case
as a fallback of the previous.
- mail: now trigger postprocess_sent_message in every case, being sent or not, as the state
is propagated in the method; udpated all addons accordingly;
- email_template: fixed URL to edit it in website + form view;
- mass_mailing: barchart now send jsonified value;
- mass_mailing: tweaking the form view with all options
bzr revid: tde@openerp.com-20140408124053-o9tb14k6v47s5mjd
- now body_html is a right field on mass_mailing, editable using the website
- email_designer controller / template now works on everything that has a body
receiving its model and res_id as post parameters; it does not work only on
email tempaltes anymore
- cleaning of the mass mailing form view: reply_to managment option (either
replied go into the document, either there is a specified reply_to; it is implemented
using boolean fields instead of a selection because all options are not available
for all models ... models like contact or partner do not have a chatter or
shoudl be be used for a chatter-like use)
- send to all now instantiates a mail.compose.message; the mass mailign processing
is delegated to the wizard itself.
bzr revid: tde@openerp.com-20140407170346-hpklabi513xskd07
and better managemetn from the mass mailing form view (still WIP).
Also integrated basic statbutton, but they have to be improved.
bzr revid: tde@openerp.com-20140403152329-u81p60c7f8rgypaz