Class: ActionMailer::MailDeliveryJob

Inherits:
ActiveJob::Base
  • Object
show all
Defined in:
lib/action_mailer/mail_delivery_job.rb

Overview

The ActionMailer::MailDeliveryJob class is used when you want to send emails outside of the request-response cycle. It supports sending either parameterized or normal mail.

Exceptions are rescued and handled by the mailer class.

Instance Method Summary collapse

Instance Method Details

#perform(mailer, mail_method, delivery_method, args:, params: nil) ⇒ Object

:nodoc:



16
17
18
19
# File 'lib/action_mailer/mail_delivery_job.rb', line 16

def perform(mailer, mail_method, delivery_method, args:, params: nil) #:nodoc:
  mailer_class = params ? mailer.constantize.with(params) : mailer.constantize
  mailer_class.public_send(mail_method, *args).send(delivery_method)
end