Setting a default queue for ActionMailer deliver_later?

孤者浪人 提交于 2019-12-04 00:07:06
mrstif

Before Rails 5

Looking through Rails' source code you can see that they already set the default queue name as 'mailers'.

Still, if you want to change that default you can always override it by including the following code in an initialiser or loaded lib file:

class ActionMailer::DeliveryJob
  queue_as :default_mailer_queue
end

Since Rails 5

Rails 5 allows you to set the default queue naming by simply configuring it.

E.g. add to you application.rb:

config.action_mailer.deliver_later_queue_name = 'default_mailer_queue'
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!