chore: Disable message hooks for conversations without incoming message (#7620)
When using client APIs to create conversations and auto-assignment is turned on, welcome messages were getting triggered. This PR disable the behaviour and ensure template hooks are triggered only if there are incoming messages present. Fixes: https://linear.app/chatwoot/issue/CW-2187
This commit is contained in:
@@ -3,6 +3,7 @@ class MessageTemplates::HookExecutionService
|
||||
|
||||
def perform
|
||||
return if conversation.campaign.present?
|
||||
return if conversation.last_incoming_message.blank?
|
||||
|
||||
trigger_templates
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user