123456789_123456789_123456789_123456789_123456789_

Class: ActionMailer::Parameterized::MessageDelivery

Do not use. This class is for internal use only.
Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: ActionMailer::MessageDelivery
Defined in: actionmailer/lib/action_mailer/parameterized.rb

Class Method Summary

Instance Attribute Summary

::ActionMailer::MessageDelivery - Inherited

#processed?

Was the delegate loaded, causing the mailer action to be processed?

Instance Method Summary

::ActionMailer::MessageDelivery - Inherited

#deliver_later

Enqueues the email to be delivered through Active Job.

#deliver_later!

Enqueues the email to be delivered through Active Job.

#deliver_now

Delivers an email:

#deliver_now!

Delivers an email without checking perform_deliveries and raise_delivery_errors, so use with caution.

#message

Returns the resulting ::Mail::Message

#enqueue_delivery,
#processed_mailer

Returns the processed Mailer instance.

#__getobj__

::Method calls are delegated to the ::Mail::Message that’s ready to deliver.

#__setobj__

Unused except for delegator internals (dup, marshalling).

::Delegator - Inherited

::ActiveSupport::Tryable - Included

Constructor Details

.new(mailer_class, action, params) ⇒ MessageDelivery

[ GitHub ]

  
# File 'actionmailer/lib/action_mailer/parameterized.rb', line 131

def initialize(mailer_class, action, params, ...)
  super(mailer_class, action, ...)
  @params = params
end

Instance Method Details

#enqueue_delivery(delivery_method, options = {}) (private)

[ GitHub ]

  
# File 'actionmailer/lib/action_mailer/parameterized.rb', line 144

def enqueue_delivery(delivery_method, options = {})
  if processed?
    super
  else
    @mailer_class.delivery_job.set(options).perform_later(
      @mailer_class.name, @action.to_s, delivery_method.to_s, params: @params, args: @args)
  end
end

#processed_mailer (private)

[ GitHub ]

  
# File 'actionmailer/lib/action_mailer/parameterized.rb', line 137

def processed_mailer
  @processed_mailer ||= @mailer_class.new.tap do |mailer|
    mailer.params = @params
    mailer.process @action, *@args
  end
end