aboutsummaryrefslogblamecommitdiffstats
path: root/actionmailer/lib/action_mailer/delivery_job.rb
blob: 95231411fbdb31c069abbe4850ea25903d87fa83 (plain) (tree)
1
2
3
4
5
6
7
8
9


                    

                                                                 
                                              

                     
                                                                     
                                                                              


       
require 'active_job'

module ActionMailer
  # The <tt>ActionMailer::DeliveryJob</tt> class is used when you
  # want to send emails outside of the request-response cycle.
  class DeliveryJob < ActiveJob::Base #:nodoc:
    queue_as :mailers

    def perform(mailer, mail_method, delivery_method, *args) #:nodoc#
      mailer.constantize.public_send(mail_method, *args).send(delivery_method)
    end
  end
end