[FIX] mail_tracking_mailgun: Message error on bounce
This commit is contained in:
parent
ed69644616
commit
07e9a8ac54
@ -7,7 +7,7 @@
|
||||
{
|
||||
"name": "Mail tracking for Mailgun",
|
||||
"summary": "Mail tracking and Mailgun webhooks integration",
|
||||
"version": "10.0.1.1.1",
|
||||
"version": "10.0.1.1.2",
|
||||
"category": "Social Network",
|
||||
"website": "https://odoo-community.org/",
|
||||
"author": "Tecnativa, "
|
||||
|
@ -30,8 +30,7 @@ class ResPartner(models.Model):
|
||||
body = _('Email has been bounced: %s\n'
|
||||
'Reason: %s\n'
|
||||
'Event: %s') % (partner.email, reason,
|
||||
event and event.get('Message-Id',
|
||||
_('unknown')))
|
||||
event and event.id or _('unknown'))
|
||||
partner.message_post(body=body)
|
||||
|
||||
@api.multi
|
||||
|
@ -389,10 +389,10 @@ class TestMailgun(TransactionCase):
|
||||
|
||||
def test_email_bounced_set(self):
|
||||
message_number = len(self.partner.message_ids) + 1
|
||||
self.partner._email_bounced_set('test_error', self.event)
|
||||
self.partner._email_bounced_set('test_error', False)
|
||||
self.assertEqual(len(self.partner.message_ids), message_number)
|
||||
self.partner.email = ""
|
||||
self.partner._email_bounced_set('test_error', self.event)
|
||||
self.partner._email_bounced_set('test_error', False)
|
||||
self.assertEqual(len(self.partner.message_ids), message_number)
|
||||
|
||||
@mock.patch(_packagepath + '.models.mail_tracking_email.requests')
|
||||
|
Loading…
Reference in New Issue
Block a user