diff --git a/.changeset/loud-foxes-grin.md b/.changeset/loud-foxes-grin.md new file mode 100644 index 000000000000..3fa989aa0dd2 --- /dev/null +++ b/.changeset/loud-foxes-grin.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +fix: Visitor message not being sent to webhook due to wrong validation of settings diff --git a/apps/meteor/app/livechat/server/hooks/sendToCRM.ts b/apps/meteor/app/livechat/server/hooks/sendToCRM.ts index d435da17e8ec..44b55e1b82f8 100644 --- a/apps/meteor/app/livechat/server/hooks/sendToCRM.ts +++ b/apps/meteor/app/livechat/server/hooks/sendToCRM.ts @@ -269,7 +269,7 @@ callbacks.add( if (message.token && !settings.get('Livechat_webhook_on_visitor_message')) { return message; } - if (!settings.get('Livechat_webhook_on_agent_message')) { + if (!message.token && !settings.get('Livechat_webhook_on_agent_message')) { return message; } // if the message has a type means it is a special message (like the closing comment), so skips