chore: Campaign conversations should be created in open state (#8209)

- Ensure that conversations originating from campaigns are created in the open state.
This commit is contained in:
Sojan Jose
2023-10-25 13:03:08 -07:00
committed by GitHub
parent 54bc4c23df
commit 8c67ea56e7
2 changed files with 9 additions and 0 deletions

View File

@@ -226,6 +226,10 @@ class Conversation < ApplicationRecord
end
def mark_conversation_pending_if_bot
# Message template hooks aren't executed for conversations from campaigns
# So making these conversations open for agent visibility
return if campaign.present?
# TODO: make this an inbox config instead of assuming bot conversations should start as pending
self.status = :pending if inbox.active_bot?
end