'Perform any post-processing necessary after sending ``mail``
successfully, including deleting it completely along with its
attachment if the ``auto_delete`` flag of the mail was set.
Overridden by subclasses for extra post-processing behaviors.
:param browse_record mail: the mail that was just sent
:return: True'

@api.multi
def _postprocess_sent_message(self, mail_sent=True):

    notif_emails = self.filtered((lambda email: email.notification))
    if notif_emails:
        notifications = self.env['mail.notification'].search([('mail_message_id', 'in', notif_emails.mapped('mail_message_id').ids), ('is_email', '=', True)])
        if mail_sent:
            notifications.write({'email_status': 'sent'})
        else:
            notifications.write({'email_status': 'exception'})
    if mail_sent:
        self.sudo().filtered((lambda self: self.auto_delete)).unlink()
    return True
