diff options
| author | David Beguin <dbe@odoo.com> | 2018-11-09 14:37:42 +0000 |
|---|---|---|
| committer | David Beguin <dbe@odoo.com> | 2018-11-20 11:37:05 +0000 |
| commit | 1007df3dc3413b2b30af8a3feba023840f7566a3 (patch) | |
| tree | a1eace90c6e65eebe1b4a4eef26ecb415a4a1ea4 /addons/mass_mailing/wizard/mail_compose_message.py | |
| parent | e69b89b8fa8439fea27094ef86d97ffd8972124c (diff) | |
[IMP] mass_mailing : apply email_normalized on _get_opt_out_list
To avoid sending mail to an opted-out mass_mailing_contact with email address
that is not strictly an email address (a <a@a.com> instead of a@a.com),
the the get_opt_out method must be adapted to use the email_normalized field,
as this method is only useful for that specific model.
Task ID : 1896677
Diffstat (limited to 'addons/mass_mailing/wizard/mail_compose_message.py')
| -rw-r--r-- | addons/mass_mailing/wizard/mail_compose_message.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/addons/mass_mailing/wizard/mail_compose_message.py b/addons/mass_mailing/wizard/mail_compose_message.py index 782d7641190..d0804977301 100644 --- a/addons/mass_mailing/wizard/mail_compose_message.py +++ b/addons/mass_mailing/wizard/mail_compose_message.py @@ -62,10 +62,9 @@ class MailComposeMessage(models.TransientModel): for res_id in res_ids: mail_values = res[res_id] if mail_values.get('email_to'): - recips = tools.email_split(mail_values['email_to']) + mail_to = tools.email_normalize(mail_values['email_to']) else: - recips = tools.email_split(partners_email.get(res_id)) - mail_to = recips[0].lower() if recips else False + mail_to = tools.email_normalize(partners_email.get(res_id)) if (opt_out_list and mail_to in opt_out_list) or (seen_list and mail_to in seen_list) \ or (not mail_to or not email_re.findall(mail_to)): # prevent sending to blocked addresses that were included by mistake |
