闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
334 B

  1. # frozen_string_literal: true
  2. class DigestMailerWorker
  3. include Sidekiq::Worker
  4. sidekiq_options queue: 'mailers'
  5. def perform(user_id)
  6. user = User.find(user_id)
  7. return unless user.settings.notification_emails['digest']
  8. NotificationMailer.digest(user.account).deliver_now!
  9. user.touch(:last_emailed_at)
  10. end
  11. end