Skip to content

Comments

[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
Tecnativa:18.0-mail_gateway_whatsapp-error
Feb 2, 2026
Merged

[18.0][IMP] mail_gateway, mail_gateway_whatsapp: Handle and display errors when sending a message through the gateway#1807
OCA-git-bot merged 3 commits intoOCA:18.0from
Tecnativa:18.0-mail_gateway_whatsapp-error

Conversation

@carlos-lopez-tecnativa
Copy link
Contributor

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#L36

This 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
image

After

image

…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 pedrobaeza added this to the 18.0 milestone Feb 2, 2026
Copy link
Member

@etobella etobella left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/ocabot merge patch

Thanks for handling it

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 18.0-ocabot-merge-pr-1807-by-etobella-bump-patch, awaiting test results.

@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 4b22bea. Thanks a lot for contributing to OCA. ❤️

@OCA-git-bot OCA-git-bot merged commit d2e6c4f into OCA:18.0 Feb 2, 2026
5 of 7 checks passed
@carlos-lopez-tecnativa carlos-lopez-tecnativa deleted the 18.0-mail_gateway_whatsapp-error branch February 2, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants