From cf7dac5bab12a1df38168e41109c5ec5427678c9 Mon Sep 17 00:00:00 2001 From: Pranav Raj S Date: Tue, 6 Sep 2022 18:14:36 +0530 Subject: [PATCH] chore: Add feature flag for conversation continuity in API (#5399) - Add the ability to toggle conversation continuity in API channel --- app/models/message.rb | 6 +++++- config/features.yml | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/models/message.rb b/app/models/message.rb index 68e4e34af..a2382ae3a 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -202,8 +202,12 @@ class Message < ApplicationRecord inbox.web_widget? && inbox.channel.continuity_via_email end + def email_notifiable_api_channel? + inbox.api? && inbox.account.feature_enabled?('email_continuity_on_api_channel') + end + def email_notifiable_channel? - email_notifiable_webwidget? || %w[Email].include?(inbox.inbox_type) + email_notifiable_webwidget? || %w[Email].include?(inbox.inbox_type) || email_notifiable_api_channel? end def can_notify_via_mail? diff --git a/config/features.yml b/config/features.yml index 222f75520..3a08b99ba 100644 --- a/config/features.yml +++ b/config/features.yml @@ -11,3 +11,5 @@ enabled: false - name: disable_branding enabled: false +- name: email_continuity_on_api_channel + enabled: false