Chore: Routine Bugfixes and enhancements (#979)

- Fix slack scopes
- Docs for authentication
Fixes: #704 , #973
This commit is contained in:
Sojan Jose
2020-06-25 23:35:16 +05:30
committed by GitHub
parent 0aab717bb3
commit 4f83d5451e
32 changed files with 254 additions and 147 deletions

View File

@@ -1,22 +1,15 @@
class Twilio::OutgoingMessageService
pattr_initialize [:message!]
class Twilio::SendOnTwilioService < Base::SendOnChannelService
private
def perform
return if message.private
return if message.source_id
return if inbox.channel.class.to_s != 'Channel::TwilioSms'
return unless outgoing_message?
def channel_class
Channel::TwilioSms
end
def perform_reply
twilio_message = client.messages.create(message_params)
message.update!(source_id: twilio_message.sid)
end
private
delegate :conversation, to: :message
delegate :contact, to: :conversation
delegate :contact_inbox, to: :conversation
def message_params
params = {
body: message.content,