chatwoot/app/presenters
Muhsin Keloth d0ecdc14d8
feat(webhooks): Emit inbox_updated when an inbox is disconnected (#14504)
Chatwoot now lets external apps know when an inbox loses its connection
and needs re-authentication. When a channel's authorization expires (for
example, an email inbox disconnects), Chatwoot fires an `inbox_updated`
webhook reflecting the new `reauthorization_required` status, and fires
it again once the inbox is re-authenticated. Integrators can keep their
own view of which inboxes are healthy without polling the API.

This is gated behind the `ENABLE_INBOX_EVENTS` installation flag — the
**Inbox updated** webhook subscription only appears in the dashboard
when that flag is enabled, so no event is offered that the backend
wouldn't dispatch.

Fixes
https://linear.app/chatwoot/issue/CW-7148/emit-inbox-webhook-when-an-inbox-is-disconnected

## How to test

1. Set `ENABLE_INBOX_EVENTS=true` and restart the app.
2. In **Settings → Integrations → Webhooks**, add a webhook and
subscribe to **Inbox updated**.
3. Disconnect an inbox — let an email/Instagram channel hit its
auth-error threshold, or run `inbox.channel.prompt_reauthorization!` in
a console.
4. The endpoint receives an `inbox_updated` event whose
`changed_attributes` shows `reauthorization_required` flipping to
`true`.
5. Re-authenticate the inbox (or run `inbox.channel.reauthorized!`) —
the endpoint receives the `true → false` transition.
6. Confirm the **Inbox updated** option is hidden when
`ENABLE_INBOX_EVENTS` is unset.

---------

Co-authored-by: Muhsin <12408980+muhsin-k@users.noreply.github.com>
2026-05-22 09:00:18 +04:00
..
conversations fix: strip markdown hard-break backslashes from webhook payloads (#13950) 2026-04-16 13:19:35 +05:30
inbox feat(webhooks): Emit inbox_updated when an inbox is disconnected (#14504) 2026-05-22 09:00:18 +04:00
messages fix: index email subject from conversation for outbound messages (#14122) 2026-04-22 20:36:35 +05:30
reports feat(v4): Update the report pages to show aggregate values (#10766) 2025-01-28 09:19:18 +05:30
agent_bot_presenter.rb Chore: API Improvements (#3469) 2021-11-27 00:48:46 +05:30
html_parser.rb Fix: parse verification mail (#3864) 2022-01-27 15:45:26 -08:00
mail_presenter.rb fix(mailbox): handle malformed sender address headers (#13486) 2026-02-11 11:02:38 -08:00
message_content_presenter.rb fix: strip markdown hard-break backslashes from webhook payloads (#13950) 2026-04-16 13:19:35 +05:30