fix: Manage Twilio SMS channel via inbox API (#11457)

- Currently Chatwoot manages Twilio Inbox creation in a separate
controller , We want to move this to inboxes api so that we have a
unified API for inbox related changes

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
Sojan Jose
2025-05-14 23:58:54 -07:00
committed by GitHub
parent ac884f58f5
commit a4c7b73888
4 changed files with 54 additions and 0 deletions

View File

@@ -30,6 +30,11 @@ class Channel::TwilioSms < ApplicationRecord
# The same parameter is used to store api_key_secret if api_key authentication is opted
validates :auth_token, presence: true
EDITABLE_ATTRS = [
:account_sid,
:auth_token
].freeze
# Must have _one_ of messaging_service_sid _or_ phone_number, and messaging_service_sid is preferred
validates :messaging_service_sid, uniqueness: true, presence: true, unless: :phone_number?
validates :phone_number, absence: true, if: :messaging_service_sid?