diff options
author | Gannon McGibbon <gannon.mcgibbon@gmail.com> | 2018-11-30 17:33:35 -0500 |
---|---|---|
committer | Gannon McGibbon <gannon.mcgibbon@gmail.com> | 2018-12-04 11:00:34 -0500 |
commit | f5050d998def98563f8fa4b381c09f563681f159 (patch) | |
tree | 0d32f8ccaddaf9bf7e1dd061658f58b8877f2f78 /actionmailer/lib/action_mailer/delivery_job.rb | |
parent | 609c58bfa6df58b88e3eadebb1f1d49354541d24 (diff) | |
download | rails-f5050d998def98563f8fa4b381c09f563681f159.tar.gz rails-f5050d998def98563f8fa4b381c09f563681f159.tar.bz2 rails-f5050d998def98563f8fa4b381c09f563681f159.zip |
Add MailDeliveryJob for unified mail delivery
Add `MailDeliveryJob` for delivering both regular and parameterized mail.
Deprecate using `DeliveryJob` and `Parameterized::DeliveryJob`.
Diffstat (limited to 'actionmailer/lib/action_mailer/delivery_job.rb')
-rw-r--r-- | actionmailer/lib/action_mailer/delivery_job.rb | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/actionmailer/lib/action_mailer/delivery_job.rb b/actionmailer/lib/action_mailer/delivery_job.rb index 8af2097819..f228006920 100644 --- a/actionmailer/lib/action_mailer/delivery_job.rb +++ b/actionmailer/lib/action_mailer/delivery_job.rb @@ -12,9 +12,16 @@ module ActionMailer rescue_from StandardError, with: :handle_exception_with_mailer_class - def perform(mailer, mail_method, delivery_method, params, *args) #:nodoc: - mailer_class = params ? mailer.constantize.with(params) : mailer.constantize - mailer_class.public_send(mail_method, *args).send(delivery_method) + before_perform do + ActiveSupport::Deprecation.warn <<~MSG.squish + Sending mail with DeliveryJob and Parameterized::DeliveryJob + is deprecated and will be removed in Rails 6.1. + Please use MailDeliveryJob instead. + MSG + end + + def perform(mailer, mail_method, delivery_method, *args) #:nodoc: + mailer.constantize.public_send(mail_method, *args).send(delivery_method) end private |