Skip to content
Snippets Groups Projects
Unverified Commit 2202e8e4 authored by Robot Odoo's avatar Robot Odoo Committed by GitHub
Browse files

[MERGE][ADD] mass_mailing_sms: allow to perform SMS batch sending

PURPOSE

SMS are a powerful marketing tool. For instance it is perfect to announce a
sale or to communicate a coupon code, to welcome a new customer in a fidelity
program, ...

Purpose of this task is to integrate SMS sending in batch in mass mailing. It
will use same mailing objects but sending SMS instead of emails. Some metrics
and flows will have to be slightly updated at the same time.

SPECIFICATIONS

Purpose of this merge is to add Mass SMS application allowing to send SMS
in batch. It is build on mass mailing application but with its own menus,
views and flows.

See sub commits for more details. Here is a summary of main changes
in this merge.

PHONE BLACKLIST

Add a blacklist mechanism for phone numbers used to send SMS like
what already exists for email addresses when sending emails.

Define a new phone.blacklist model, holding a number and the state of the
blacklist (active field), as well as tools methods to access it. Make it
as private as possible, accessing it in sudo once access are granted.

Define a new mail.thread.phone mixin computing the blacklist status of a
record.

BLACKLIST / ERROR IN COMPOSER

Support blacklisted and already-done numbers when sending SMS :

* blacklist support: necessary to avoid sending SMS in batch to people that
asked to stop being spammed;
* already-done support: when performing mailing in batch or doing A/B testing
we may have already-done SMS;

When sending SMS in batch, already update state and error code of SMS that
should not be sent

* blacklisted number: set to canceled, with blacklist error code;
* duplicated number: set to canceled, with duplicated error code;
* invalid number (cannot sanitize): set to error, with either missing number
if void or wrong format if not void;

SPEEDUP BATCH LOGGING

Allow quick message creation by allowing create multi on mail.message.
Also introduce a new helper tool method to log in batch on records.

IMPROVE SMS COMPOSER ONBOARDING AND USE

Clean the use and options of sms composer after FP feedback, notably

* see https://s.nimbusweb.me/share/3167586/ap1xpy95rz29a5cys576 as basis;
* globally, do not display invalid recipients, only valid / invalid count
as well as current selection / active domain counts;
* consider logging a note as default behavior when using the composer;
* simplify code: when doing a mass SMS, send SMS and attach a simple note
to the document;

Limit use of templates to models that are really capable of sending
SMS. Templates are now available on models that inherit from mail.thread
and effectively have fields used in SMS sending.

MASS MAILING PREPARATION

Prepare mass mailing module to addition of mass_mailing_sms.

Mailing model: mailing type
* add a mailing_type selection field;
* mass mailing contains only 'mail';
* synchronize medium accordingly;
* update actions of mass mailing application to add a domain on mailing
type being 'mail';

Mailing contact
* remove is_email_valid field as its purpose is achieved by email_normalized
field coming from address mixin (added by blacklist management);

Mailing contact subscription
* clean a bit fields and views as this should stay a technical model;

Trace model and report: trace type
* add a trace_type selection field;
* mass mailing contains only 'mail';

ADD MASS MAILING SMS

Create a new application called "Mass SMS" that follows the structure of
mass_mailing application.

General guidelines

* use the fa-comment icon for this module;
* add a "Notification type" field to the mailings: email or sms. Set it
invisible and set as domain from context when choosing mass mailing or
mass sms application (menus / action specific);
* adapt the metrics from Mass Mailing to SMS
* sent = received = whether the SMS was sent or not;
* opened => we don't have this information;
* replied => we don't have this information;
* clicks = from link tracker (no change of behavior);
* bounced = SMS that failed to be delivered because the format is wrong;
* exception = any issue when sending SMS;
* keep the Mailing Lists menu, hide email related fields on contact model;
* settings: hide the "Specific Mail Server" feature

Opt-out and blacklist handling

* we do support mailing lists because they could come from different sources
and are a way to communicate with a specific audience (and not just a list
we bought), e.g. subscribe to this list to be kept updated whenever this
product is back in stock, or to receive results of this ...
* if the SMSing is from a list, opt-out removes ourselves from the list;
* if it is from the contact ==> Sent to blacklist;
* allow to attach unsubscription links in sent SMS, redirecting to a new
route in mass mailing SMS allowing quick unsubscribe and/or blacklist
of phone numbers;

Error management

* if the user clicks on Send Now / Schedule / Test and does not have enough
credits, open the "Insufficient credits" modal in a lazy option (aka when
having failed statistics linked to insufficient credits);
* on the mailing, we however display this failure as :
* a message on the mailing kanban view
* a message on the top of the form view + same behavior as the mailing and
"Could not be sent" https://www.screencast.com/t/BExgd1Gc;



LINKS

Task 1997464
PR #34424
Original SMS addition: Task 1922163 (4287481b)

Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
parents 22b598bc 8aec3c0f
Branches
Tags
No related merge requests found
Showing
with 277 additions and 225 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment