docbrown/app/workers/mentions/send_email_notification_worker.rb
Andy Zhao 7d3bf4b753
[15-min-fix] Ensure mention worker delivers email (#14038)
* Ensure mention worker delivers email

* Fix spec to appropriately check if mailer was touched
2021-06-22 14:29:56 -04:00

13 lines
323 B
Ruby

module Mentions
class SendEmailNotificationWorker
include Sidekiq::Worker
sidekiq_options queue: :default, retry: 10
def perform(mention_id)
mention = Mention.find_by(id: mention_id)
return unless mention
NotifyMailer.with(mention: mention).new_mention_email.deliver_now
end
end
end