-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to fix "Sending mail with DeliveryJob and Parameterized::DeliveryJob is deprecated" deprecation? #37068
Comments
Have you set the |
Thank you @louim, this has removed all the warnings. |
Just as a heads up for other people running into this while upgrading: it doesn't seem to work to uncomment the relevant line in the generated Might also be something peculiar about my app. |
- Deprecation warning raised when sending mail - "Sending mail with DeliveryJob and Parameterized::DeliveryJob is deprecated" - Fix rails/rails#37068
- Deprecation warning raised when sending mail - "Sending mail with DeliveryJob and Parameterized::DeliveryJob is deprecated" - Fix rails/rails#37068
- Deprecation warning raised when sending mail - "Sending mail with DeliveryJob and Parameterized::DeliveryJob is deprecated" - Fix rails/rails#37068
@louim |
@modullar If you are using The root of the problem is often that ActionMailer is loaded too early before the setting is applied. This makes ActionMailer use the deprecated class, hence the warning. One other possible cause could be a gem referencing the old class directly. Look if you have gems that send email that were not updated. Hope that helps! |
Steps to reproduce
Upgrading from Rails 5 to 6 an application which has calls to
deliver_later
method.I changed the old style of passing formal parameters to the new one using
with
and callingparams
inside the mailer; I have removed the queue parameter which I was using previously in some of thedeliver_later
calls.All my mailers inherit from ApplicationMailer which inherits from ActionMailer::Base, there is nothing special from what I'm able to figure out.
There is nothing special I can recall in my configurations about mailers.
Expected behavior
No warnings or an explanation about what to do, since I was not able to figure out what I'm supposed to do to fix this and be prepared to 6.1
Actual behavior
All calls to
deliver_later
present the warning:But I'm not using directly DeliveryJob! I got the warnings in all my tests (models, controllers, integration), both from direct calls in controllers and also from inside other jobs.
System configuration
Rails 6.0.0:
Ruby 2.6.3p62:
The text was updated successfully, but these errors were encountered: