Sending delayed email from devise

后端 未结 4 1892
长情又很酷
长情又很酷 2021-02-03 13:43

Is there a simple way of telling Devise to send all email via delayed_job?

4条回答
  •  你的背包
    2021-02-03 14:41

    I have no idea what Devise is but I guess it is third-party gem you don't want to modify. Try delayed_job_mailer. You can extend Devise mailers by monkey patching them to use delayed_job.

    class SomeExistingMailer
      include Delayed::Mailer
    end
    

    or if you want to send all app emails via delayed job by default:

    # config/initializers/delayed_mailer.rb
    class ActionMailer::Base
      include Delayed::Mailer
    end
    

提交回复
热议问题