summaryrefslogtreecommitdiff
path: root/addons/sms/models
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2019-07-26 11:43:55 +0000
committerThibault Delavallée <tde@odoo.com>2019-08-12 12:00:22 +0000
commit5d1f08a01289375acbe44c2f33d95869477cdb1e (patch)
tree1996e222ad5a9b711b964e9c36aae4347affd521 /addons/sms/models
parent7e8a02cd6e9f08e5ff45db804b357bc3537ff1f6 (diff)
[IMP] sms: integrate duplicate / blacklist into composer in batch mode
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 commit is to 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; Support of blacklist / duplicated / invalid will notably be used when performing SMS marketing (mass SMS) and marketing automation using mass SMS. LINKS Task 1997464 PR #34424 Original SMS addition: Task 1922163 (4287481)
Diffstat (limited to 'addons/sms/models')
-rw-r--r--addons/sms/models/sms_sms.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/sms/models/sms_sms.py b/addons/sms/models/sms_sms.py
index fbc68011439..972c03bd8f7 100644
--- a/addons/sms/models/sms_sms.py
+++ b/addons/sms/models/sms_sms.py
@@ -29,7 +29,10 @@ class SmsSms(models.Model):
('sms_number_missing', 'Missing Number'),
('sms_number_format', 'Wrong Number Format'),
('sms_credit', 'Insufficient Credit'),
- ('sms_server', 'Server Error')
+ ('sms_server', 'Server Error'),
+ # mass mode specific codes
+ ('sms_blacklist', 'Blacklisted'),
+ ('sms_duplicate', 'Duplicate'),
])
def send(self, delete_all=False, auto_commit=False, raise_exception=False):