2021-10-14 07:25:46 +00:00
|
|
|
class EmailReplyWorker
|
|
|
|
include Sidekiq::Worker
|
2021-12-15 12:01:16 +00:00
|
|
|
sidekiq_options queue: :mailers, retry: 3
|
2021-10-14 07:25:46 +00:00
|
|
|
|
|
|
|
def perform(message_id)
|
|
|
|
message = Message.find(message_id)
|
|
|
|
|
2022-02-15 11:41:28 +00:00
|
|
|
return unless message.email_notifiable_message?
|
2021-10-14 07:25:46 +00:00
|
|
|
|
|
|
|
# send the email
|
|
|
|
ConversationReplyMailer.with(account: message.account).email_reply(message).deliver_later
|
|
|
|
end
|
|
|
|
end
|