You can specify which queue to use when calling deliver_later in an ActionMailer by adding :queue as optional argument, e.g.:
Notifier.welcome(User.first.id).deliver_later(queue: "low")
Is there a way to do this in a general way, for all ActionMailers? To set the default ActionMailer queue?
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'