diff --git a/app/models/concerns/smooch_resend.rb b/app/models/concerns/smooch_resend.rb index 883ed49cd1..455ce33ac8 100644 --- a/app/models/concerns/smooch_resend.rb +++ b/app/models/concerns/smooch_resend.rb @@ -159,6 +159,7 @@ def message_tags_payload(text, image = nil) def resend_facebook_messenger_message_after_window(message, original) original = JSON.parse(original) unless original.blank? uid = message['appUser']['_id'] + RequestStore.store[:smooch_bot_provider] = 'ZENDESK' return self.resend_facebook_messenger_report_after_window(message, original) if original&.dig('fallback_template') =~ /report/ @@ -184,6 +185,7 @@ def resend_facebook_messenger_message_after_window(message, original) end def resend_facebook_messenger_report_after_window(message, original) + RequestStore.store[:smooch_bot_provider] = 'ZENDESK' pm = ProjectMedia.where(id: original['project_media_id']).last report = self.get_report_data_to_be_resent(message, original) unless report.nil? diff --git a/app/workers/tipline_newsletter_worker.rb b/app/workers/tipline_newsletter_worker.rb index 45adefa1ae..a0458ded23 100644 --- a/app/workers/tipline_newsletter_worker.rb +++ b/app/workers/tipline_newsletter_worker.rb @@ -39,6 +39,7 @@ def perform(team_id, language, job_created_at = 0) begin RequestStore.store[:smooch_bot_platform] = ts.platform Bot::Smooch.get_installation('team_bot_installation_id', tbi.id) { |i| i.id == tbi.id } + RequestStore.store[:smooch_bot_provider] = 'ZENDESK' if ts.platform != 'WhatsApp' # Adjustment for tiplines running CAPI and Smooch at the same time response = (ts.platform == 'WhatsApp' ? Bot::Smooch.send_message_to_user(ts.uid, newsletter.format_as_template_message, {}, false, true, 'newsletter') : Bot::Smooch.send_message_to_user(ts.uid, *newsletter.format_as_tipline_message))