开发者

Rails 3 - Delayed_Job - For all emails

开发者 https://www.devze.com 2023-01-23 20:51 出处:网络
Is there a way using a Rails 3 initializer to make all application emails sent out by delayed_job by default?

Is there a way using a Rails 3 initializer to make all application emails sent out by delayed_job by default?

I tried something like this:

# confi开发者_运维百科g/initializers/delayed_mailer.rb
class ActionMailer::Base
  Delayed::Worker
end

But it errors with:

execution expired


Can you override ActionMailer::Base.deliver to do Delayed::Job.enqueue self? Also, take out Delayed::Worker, I think that's run via the rake task to pop things off the queue. Also, if you're going to monkey patch things, make note of it in initializers or make a patches directory that is read by an initializer.

0

精彩评论

暂无评论...
验证码 换一张
取 消