简体   繁体   中英

ActionMailer observers not working with delayed_job

I have an ActionMailer observer that's working just fine during normal sends, but when I send the delivery to delayed_job, it doesn't get called at all. Is this a function of delayed_job itself, or something specific with my observer?

Controller:

BulkMailer.delay.blast(recipients, email, template)

Initializer:

ActionMailer::Base.register_observer(MailObserver)

Observer

class MailObserver
  def self.delivered_email(message)
    Rails.logger.debug 'Message: finished'
  end
end

The code itself was fine, Delayed Job and ActionMailer observers are compatible. My problem was solved by restarting the workers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM