-
Notifications
You must be signed in to change notification settings - Fork 21.7k
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
Allow mailers to configure their delivery job #29457
Allow mailers to configure their delivery job #29457
Conversation
Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @pixeltrix (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. This repository is being automatically checked for code quality issues using Code Climate. You can see results for this analysis in the PR status below. Newly introduced issues should be fixed before a Pull Request is considered ready to review. Please see the contribution instructions for more information. |
62b3a04
to
4399b2a
Compare
Setting delivery_job on a mailer class will cause MessageDelivery to use the specified job instead of ActionMailer::DeliveryJob: class MyMailer < ApplicationMailer self.delivery_job = MyCustomDeliveryJob ... end
4399b2a
to
d9bbde0
Compare
I believe the CI failure is unrelated to my changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
…eued_emails` to filter delivery job Since rails#29457, delivery job can specified for each mailer. Added the `:only` option to make helper method usable even when deliver job is specified.
Hello,
is it rails version issue ? |
@eftikharEmad this change made it into 5.2.0 so if you're using an earlier version then yes. |
Hi! Thanks for this PR @halogenandtoast 😄 |
@jerryskye parameterized mailers got inlined, such that this config works for them on Rails 6. See #34367, though we won't backport it as mentioned in #35215 |
Setting delivery_job on a mailer class will cause MessageDelivery to use
the specified job instead of ActionMailer::DeliveryJob
Summary
In some situations, a user may want to configure the delivery job in order to have
better control over errors (For example, retrying the job when deserialization fails
due to replica databases not being up to date). This adds an option to each mailer
class that can be configured to handle such behavior.