feat: Add campaigns in web widget (#2227)

* add campaign store(getter, actions and mutations)

* add campaign store module

* add get campaigns api

* add fetch campaign action widget load

* add specs

* code cleanup

* trigger campaig api fixes

* integrate campaign trigger action

* code cleanup

* revert changes

* trigger api fixes

* review fixes

* code beautification

* chore: Fix multiple campaigns being send because of race condition

* chore: rubocop

* chore: Fix specs

* disable campaigns

Co-authored-by: Nithin David Thomas <webofnithin@gmail.com>
Co-authored-by: Sojan <sojan@pepalo.com>
This commit is contained in:
Muhsin Keloth
2021-05-10 13:01:00 +05:30
committed by GitHub
parent db31bfcee4
commit 3fc646f330
15 changed files with 371 additions and 6 deletions

View File

@@ -3,9 +3,11 @@ class MessageTemplates::HookExecutionService
def perform
return if inbox.agent_bot_inbox&.active?
return if conversation.campaign.present?
# TODO: let's see whether this is needed and remove this and related logic if not
# ::MessageTemplates::Template::OutOfOffice.new(conversation: conversation).perform if should_send_out_of_office_message?
::MessageTemplates::Template::Greeting.new(conversation: conversation).perform if should_send_greeting?
::MessageTemplates::Template::EmailCollect.new(conversation: conversation).perform if should_send_email_collect?
end