Skip to content

GOWA - WhatsApp REST API with support for UI, Multi Account, Webhooks, and MCP, and Chatwoot. Built with Golang for efficient memory use.

fix: failed to send message to group chat (#739)

Wasis Haryo Sasokoe69626f9c057
diff --git a/src/ui/rest/chatwoot.go b/src/ui/rest/chatwoot.go
index 036e5a9f..9f53a7e1 100644
--- a/src/ui/rest/chatwoot.go
+++ b/src/ui/rest/chatwoot.go
@@ -249,7 +249,11 @@ func (h *ChatwootHandler) resolveChatwootWebhookRoute(payload chatwoot.WebhookPa
contact := payload.Conversation.Meta.Sender
route.Destination = chatwootContactAttrString(contact.CustomAttributes, "gowa_whatsapp_jid")
if route.Destination == "" {
- route.Destination = contact.PhoneNumber
+ if contact.PhoneNumber != "" {
+ route.Destination = contact.PhoneNumber
+ } else if contact.Identifier != "" {
+ route.Destination = contact.Identifier
+ }
}
// 2) Explicit contact override. In per-device mode the named device must be