- Auto-fixed 143 code style violations using rubocop -A - Fixed RuboCop configuration: moved rubocop-rspec_rails to plugins - Removed redundant || 0 patterns after .to_i calls - Fixed RSpec describe class format - Added remaining naming violations to exclude list for future cleanup - Reduced violations from 100 to 0 offenses
18 lines
521 B
Ruby
18 lines
521 B
Ruby
class EmailReplyWorker
|
|
include Sidekiq::Worker
|
|
|
|
sidekiq_options queue: :mailers, retry: 3
|
|
|
|
def perform(message_id)
|
|
message = Message.find(message_id)
|
|
|
|
return unless message.email_notifiable_message?
|
|
|
|
# send the email
|
|
ConversationReplyMailer.with(account: message.account).email_reply(message).deliver_now
|
|
rescue StandardError => e
|
|
ChatwootExceptionTracker.new(e, account: message.account).capture_exception
|
|
Messages::StatusUpdateService.new(message, 'failed', e.message).perform
|
|
end
|
|
end
|