[18.0][IMP] mail_gateway, mail_gateway_whatsapp: Handle and display errors when sending a message through the gateway#1807
Merged
OCA-git-bot merged 3 commits intoOCA:18.0from Feb 2, 2026
Conversation
…through the gateway By default, Odoo only filters notifications with errors for the notification_type 'email'. see https://github.com/odoo/odoo/blob/f40701dd894f01ed1a3a6360b1177a0d53552c49/addons/mail/wizard/mail_resend_message.py#L36 This commit adds the ability to display errors to the user when a gateway message fails to be sent for any reason.
…s on failures When a message fails for any reason, the POST request that creates the message in META does not contain any status. However, META notifies the status via webhook. This commit handles this notification, records the error, and notifies the user.
…nt to the API In the previous PR OCA#1717 we handled the notification via webhook when Meta returns an error. However, when the error occurs in the communication with Meta, the message is displayed as delivered. After this commit, the message is displayed as error when applicable. The failure details are only written when failure_type = 'unknown'. See: https://github.com/OCA/social/blob/695efd6fa3401614118c6a52f58453b40a9f0842/mail_gateway/models/mail_message.py#L114 So, in exception cases, we write this field to ensure it is processed correctly.
pedrobaeza
approved these changes
Feb 2, 2026
etobella
approved these changes
Feb 2, 2026
Member
etobella
left a comment
There was a problem hiding this comment.
/ocabot merge patch
Thanks for handling it
Contributor
|
This PR looks fantastic, let's merge it! |
Contributor
|
Congratulations, your PR was merged at 4b22bea. Thanks a lot for contributing to OCA. ❤️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FW-Port of #1717 #1806
By default, Odoo only filters notifications with errors for the
notification_type'email'. see https://github.com/odoo/odoo/blob/f40701dd894f01ed1a3a6360b1177a0d53552c49/addons/mail/wizard/mail_resend_message.py#L36This commit adds the ability to display errors to the user when a gateway message fails to be sent for any reason.
TT50004
@Tecnativa @pedrobaeza @CarlosRoca13 @etobella could you please review this?
Before

After