diff --git a/Gemfile b/Gemfile
index 9029ccbcb..937f0bd60 100644
--- a/Gemfile
+++ b/Gemfile
@@ -78,7 +78,7 @@ gem 'wisper', '2.0.0'
# TODO: bump up gem to 2.0
gem 'facebook-messenger'
gem 'line-bot-api'
-gem 'twilio-ruby', '~> 5.32.0'
+gem 'twilio-ruby', '~> 5.66'
# twitty will handle subscription of twitter account events
# gem 'twitty', git: 'https://github.com/chatwoot/twitty'
gem 'twitty'
diff --git a/Gemfile.lock b/Gemfile.lock
index f19ff70fa..fa8f9d9f0 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -582,8 +582,8 @@ GEM
activesupport
i18n
trailblazer-option (0.1.2)
- twilio-ruby (5.32.0)
- faraday (~> 1.0.0)
+ twilio-ruby (5.66.0)
+ faraday (>= 0.9, < 2.0)
jwt (>= 1.5, <= 2.5)
nokogiri (>= 1.6, < 2.0)
twitty (0.1.4)
@@ -730,7 +730,7 @@ DEPENDENCIES
squasher
telephone_number
time_diff
- twilio-ruby (~> 5.32.0)
+ twilio-ruby (~> 5.66)
twitty
tzinfo-data
uglifier
diff --git a/app/controllers/api/v1/accounts/channels/twilio_channels_controller.rb b/app/controllers/api/v1/accounts/channels/twilio_channels_controller.rb
index f5a3c6a6d..24a8ba7eb 100644
--- a/app/controllers/api/v1/accounts/channels/twilio_channels_controller.rb
+++ b/app/controllers/api/v1/accounts/channels/twilio_channels_controller.rb
@@ -38,6 +38,7 @@ class Api::V1::Accounts::Channels::TwilioChannelsController < Api::V1::Accounts:
@twilio_channel = Current.account.twilio_sms.create!(
account_sid: permitted_params[:account_sid],
auth_token: permitted_params[:auth_token],
+ messaging_service_sid: permitted_params[:messaging_service_sid],
phone_number: phone_number,
medium: medium
)
@@ -49,7 +50,7 @@ class Api::V1::Accounts::Channels::TwilioChannelsController < Api::V1::Accounts:
def permitted_params
params.require(:twilio_channel).permit(
- :account_id, :phone_number, :account_sid, :auth_token, :name, :medium
+ :account_id, :messaging_service_sid, :phone_number, :account_sid, :auth_token, :name, :medium
)
end
end
diff --git a/app/controllers/twilio/callback_controller.rb b/app/controllers/twilio/callback_controller.rb
index 44dcc9b6f..7723e5dd2 100644
--- a/app/controllers/twilio/callback_controller.rb
+++ b/app/controllers/twilio/callback_controller.rb
@@ -7,7 +7,7 @@ class Twilio::CallbackController < ApplicationController
private
- def permitted_params
+ def permitted_params # rubocop:disable Metrics/MethodLength
params.permit(
:ApiVersion,
:SmsSid,
@@ -25,7 +25,8 @@ class Twilio::CallbackController < ApplicationController
:ToCountry,
:FromState,
:MediaUrl0,
- :MediaContentType0
+ :MediaContentType0,
+ :MessagingServiceSid
)
end
end
diff --git a/app/javascript/dashboard/helper/inbox.js b/app/javascript/dashboard/helper/inbox.js
index 3f0eedbda..e2ff2ec41 100644
--- a/app/javascript/dashboard/helper/inbox.js
+++ b/app/javascript/dashboard/helper/inbox.js
@@ -12,7 +12,7 @@ export const getInboxClassByType = (type, phoneNumber) => {
return 'brand-twitter';
case INBOX_TYPES.TWILIO:
- return phoneNumber.startsWith('whatsapp')
+ return phoneNumber?.startsWith('whatsapp')
? 'brand-whatsapp'
: 'brand-sms';
diff --git a/app/javascript/dashboard/i18n/locale/en/inboxMgmt.json b/app/javascript/dashboard/i18n/locale/en/inboxMgmt.json
index f0ff2c2fe..2b8005e1d 100644
--- a/app/javascript/dashboard/i18n/locale/en/inboxMgmt.json
+++ b/app/javascript/dashboard/i18n/locale/en/inboxMgmt.json
@@ -111,6 +111,12 @@
"PLACEHOLDER": "Please enter your Twilio Account SID",
"ERROR": "This field is required"
},
+ "MESSAGING_SERVICE_SID": {
+ "LABEL": "Messaging Service SID",
+ "PLACEHOLDER": "Please enter your Twilio Messaging Service SID",
+ "ERROR": "This field is required",
+ "USE_MESSAGING_SERVICE": "Use a Twilio Messaging Service"
+ },
"CHANNEL_TYPE": {
"LABEL": "Channel Type",
"ERROR": "Please select your Channel Type"
diff --git a/app/javascript/dashboard/routes/dashboard/settings/inbox/Settings.vue b/app/javascript/dashboard/routes/dashboard/settings/inbox/Settings.vue
index b73289b8d..d9d05877a 100644
--- a/app/javascript/dashboard/routes/dashboard/settings/inbox/Settings.vue
+++ b/app/javascript/dashboard/routes/dashboard/settings/inbox/Settings.vue
@@ -438,7 +438,11 @@ export default {
return this.$store.getters['inboxes/getInbox'](this.currentInboxId);
},
inboxName() {
- if (this.isATwilioSMSChannel || this.isAWhatsappChannel) {
+ if (this.isATwilioSMSChannel || this.isATwilioWhatsappChannel) {
+ return `${this.inbox.name} (${this.inbox.messaging_service_sid ||
+ this.inbox.phone_number})`;
+ }
+ if (this.isAWhatsappChannel) {
return `${this.inbox.name} (${this.inbox.phone_number})`;
}
if (this.isAnEmailChannel) {
diff --git a/app/javascript/dashboard/routes/dashboard/settings/inbox/channels/Twilio.vue b/app/javascript/dashboard/routes/dashboard/settings/inbox/channels/Twilio.vue
index 27cf47437..f5439155d 100644
--- a/app/javascript/dashboard/routes/dashboard/settings/inbox/channels/Twilio.vue
+++ b/app/javascript/dashboard/routes/dashboard/settings/inbox/channels/Twilio.vue
@@ -17,6 +17,26 @@
+
+
+
+
+
+
+
+