diff options
Diffstat (limited to 'actionmailer/lib/action_mailer/parameterized.rb')
-rw-r--r-- | actionmailer/lib/action_mailer/parameterized.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/actionmailer/lib/action_mailer/parameterized.rb b/actionmailer/lib/action_mailer/parameterized.rb index 999435919e..0a97af8105 100644 --- a/actionmailer/lib/action_mailer/parameterized.rb +++ b/actionmailer/lib/action_mailer/parameterized.rb @@ -145,12 +145,20 @@ module ActionMailer if processed? super else - job = @mailer_class.delivery_job + job = delivery_job_class args = arguments_for(job, delivery_method) job.set(options).perform_later(*args) end end + def delivery_job_class + if @mailer_class.delivery_job <= MailDeliveryJob + @mailer_class.delivery_job + else + Parameterized::DeliveryJob + end + end + def arguments_for(delivery_job, delivery_method) if delivery_job <= MailDeliveryJob [@mailer_class.name, @action.to_s, delivery_method.to_s, params: @params, args: @args] |