[FIX] mass_mailing: keep invalid email on failed traces
SPECIFICATIONS Traces are sent to normalized emails. If email is invalid email set on traces is void as we cannot normalize it. In this commit we set it to the original value of email, allowing to debug or at least understand what was wrong. It also makes behavior coherent with SMS Marketing. LINKS Task ID-2508643 Prepares Task ID-27033 (support QWeb in templates) Prepares Task ID-2377974 (clean trace and status management in mass mailing) COM PR odoo/odoo#69461 ENT PR odoo/enterprise#17780 X-original-commit: af841ccece14ffee0291f761d5363eceded65dfc
This commit is contained in:
@@ -75,7 +75,8 @@ class MailComposeMessage(models.TransientModel):
|
||||
'model': self.model,
|
||||
'res_id': res_id,
|
||||
'mass_mailing_id': mass_mailing.id,
|
||||
'email': mail_to,
|
||||
# if mail_to is void, keep falsy values to allow searching / debugging traces
|
||||
'email': mail_to or mail_values.get('email_to'),
|
||||
}
|
||||
if mail_values.get('body_html') and mass_mail_layout:
|
||||
mail_values['body_html'] = mass_mail_layout._render({'body': mail_values['body_html']}, engine='ir.qweb', minimal_qcontext=True)
|
||||
|
||||
@@ -63,11 +63,8 @@ class TestMassMailing(TestMailFullCommon):
|
||||
recipient_info['state'] = 'ignored'
|
||||
# falsy: ignored (cancel mail)
|
||||
elif recipient == recipient_falsy_1:
|
||||
# TDE FIXME: currently setting False as email
|
||||
# recipient_info['state'] = 'ignored'
|
||||
# recipient_info['email'] = recipient.email_from # normalized is False but email should be falsymail
|
||||
recipient_info['state'] = 'ignored'
|
||||
recipient_info['email'] = False
|
||||
recipient_info['email'] = recipient.email_from # normalized is False but email should be falsymail
|
||||
else:
|
||||
email = self._find_sent_mail_wemail(recipient.email_normalized)
|
||||
# preview correctly integrated rendered jinja
|
||||
|
||||
Reference in New Issue
Block a user