-
- Downloads
[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:Thibault Delavallee (tde) <tde@openerp.com>
Showing
- addons/calendar/models/calendar.py 1 addition, 1 deletionaddons/calendar/models/calendar.py
- addons/calendar_sms/views/calendar_views.xml 2 additions, 1 deletionaddons/calendar_sms/views/calendar_views.xml
- addons/crm_sms/views/crm_lead_views.xml 1 addition, 0 deletionsaddons/crm_sms/views/crm_lead_views.xml
- addons/event_sms/tests/test_sms_schedule.py 2 additions, 2 deletionsaddons/event_sms/tests/test_sms_schedule.py
- addons/hr/models/hr_employee.py 2 additions, 2 deletionsaddons/hr/models/hr_employee.py
- addons/hr_presence/models/hr_employee.py 1 addition, 1 deletionaddons/hr_presence/models/hr_employee.py
- addons/mail/models/mail_message.py 68 additions, 69 deletionsaddons/mail/models/mail_message.py
- addons/mail/models/mail_thread.py 79 additions, 41 deletionsaddons/mail/models/mail_thread.py
- addons/mass_mailing/data/mass_mailing_demo.xml 8 additions, 25 deletionsaddons/mass_mailing/data/mass_mailing_demo.xml
- addons/mass_mailing/models/mail_mail.py 1 addition, 1 deletionaddons/mass_mailing/models/mail_mail.py
- addons/mass_mailing/models/mailing.py 44 additions, 19 deletionsaddons/mass_mailing/models/mailing.py
- addons/mass_mailing/models/mailing_contact.py 1 addition, 22 deletionsaddons/mass_mailing/models/mailing_contact.py
- addons/mass_mailing/models/mailing_list.py 7 additions, 0 deletionsaddons/mass_mailing/models/mailing_list.py
- addons/mass_mailing/models/mailing_trace.py 24 additions, 11 deletionsaddons/mass_mailing/models/mailing_trace.py
- addons/mass_mailing/models/utm.py 1 addition, 0 deletionsaddons/mass_mailing/models/utm.py
- addons/mass_mailing/report/mailing_trace_report.py 25 additions, 20 deletionsaddons/mass_mailing/report/mailing_trace_report.py
- addons/mass_mailing/report/mailing_trace_report_views.xml 6 additions, 4 deletionsaddons/mass_mailing/report/mailing_trace_report_views.xml
- addons/mass_mailing/static/tests/mass_mailing_html_tests.js 3 additions, 3 deletionsaddons/mass_mailing/static/tests/mass_mailing_html_tests.js
- addons/mass_mailing/tests/test_mass_mailing_shortener.py 1 addition, 1 deletionaddons/mass_mailing/tests/test_mass_mailing_shortener.py
- addons/mass_mailing/views/link_tracker_views.xml 0 additions, 2 deletionsaddons/mass_mailing/views/link_tracker_views.xml
Loading
Please register or sign in to comment