Search code examples
ruby-on-railsruby-on-rails-3delayed-job

Delayed_Job, How to set a priority for a user_mailer.rb method


I am using delayed_job w rails 3 to delay user_mailers, example:

 UserMailer.delay.email_digest(from,email,subject,html,text)

How can I add a priority? By default all delayed jobs are set to priority 0, for this mailer, I would like to make it less important with a priority of 1.

Possible? Thanks


Solution

  • Options such as priority or which queue to use are options on the delay method, for example

    UserMailer.delay(:priority => 2).email_digest(...)