a18d54b706
* Chore: Enable file upload for facebook messenger * Chore: Fix attachments * Chore: Fix Specs * Fix ReplyBox file attachment logic * Set default value for message Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
15 lines
552 B
Ruby
15 lines
552 B
Ruby
class SendReplyJob < ApplicationJob
|
|
queue_as :high
|
|
|
|
def perform(message_id)
|
|
message = Message.find(message_id)
|
|
channel_name = message.conversation.inbox.channel.class.to_s
|
|
if channel_name == 'Channel::FacebookPage'
|
|
::Facebook::SendOnFacebookService.new(message: message).perform
|
|
elsif channel_name == 'Channel::TwitterProfile'
|
|
::Twitter::SendOnTwitterService.new(message: message).perform
|
|
elsif channel_name == 'Channel::TwilioSms'
|
|
::Twilio::SendOnTwilioService.new(message: message).perform
|
|
end
|
|
end
|
|
end
|