diff --git a/app/jobs/send_reply_job.rb b/app/jobs/send_reply_job.rb index e892c189a..eec722e8d 100644 --- a/app/jobs/send_reply_job.rb +++ b/app/jobs/send_reply_job.rb @@ -2,17 +2,17 @@ class SendReplyJob < ApplicationJob queue_as :high CHANNEL_SERVICES = { - 'Channel::TwitterProfile' => ::Twitter::SendOnTwitterService, - 'Channel::TwilioSms' => ::Twilio::SendOnTwilioService, - 'Channel::Line' => ::Line::SendOnLineService, - 'Channel::Telegram' => ::Telegram::SendOnTelegramService, - 'Channel::Whatsapp' => ::Whatsapp::SendOnWhatsappService, - 'Channel::Sms' => ::Sms::SendOnSmsService, - 'Channel::Instagram' => ::Instagram::SendOnInstagramService, - 'Channel::Tiktok' => ::Tiktok::SendOnTiktokService, - 'Channel::Email' => ::Email::SendOnEmailService, - 'Channel::WebWidget' => ::Messages::SendEmailNotificationService, - 'Channel::Api' => ::Messages::SendEmailNotificationService + 'Channel::TwitterProfile' => '::Twitter::SendOnTwitterService', + 'Channel::TwilioSms' => '::Twilio::SendOnTwilioService', + 'Channel::Line' => '::Line::SendOnLineService', + 'Channel::Telegram' => '::Telegram::SendOnTelegramService', + 'Channel::Whatsapp' => '::Whatsapp::SendOnWhatsappService', + 'Channel::Sms' => '::Sms::SendOnSmsService', + 'Channel::Instagram' => '::Instagram::SendOnInstagramService', + 'Channel::Tiktok' => '::Tiktok::SendOnTiktokService', + 'Channel::Email' => '::Email::SendOnEmailService', + 'Channel::WebWidget' => '::Messages::SendEmailNotificationService', + 'Channel::Api' => '::Messages::SendEmailNotificationService' }.freeze def perform(message_id) @@ -21,10 +21,10 @@ class SendReplyJob < ApplicationJob return send_on_facebook_page(message) if channel_name == 'Channel::FacebookPage' - service_class = CHANNEL_SERVICES[channel_name] - return unless service_class + service_class_name = CHANNEL_SERVICES[channel_name] + return unless service_class_name - service_class.new(message: message).perform + service_class_name.constantize.new(message: message).perform end private