chore: Provider APIs for SMS Channel - Bandwidth (#3889)

fixes: #3888
This commit is contained in:
Sojan Jose
2022-02-03 15:22:13 -08:00
committed by GitHub
parent fba7f40bee
commit cf10f3d03b
40 changed files with 879 additions and 51 deletions

View File

@@ -0,0 +1,13 @@
class Webhooks::SmsEventsJob < ApplicationJob
queue_as :default
def perform(params = {})
return unless params[:type] == 'message-received'
channel = Channel::Sms.find_by(phone_number: params[:to])
return unless channel
# TODO: pass to appropriate provider service from here
Sms::IncomingMessageService.new(inbox: channel.inbox, params: params[:message].with_indifferent_access).perform
end
end