-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Refactor NotificationMailer
to use parameterization
#25718
Conversation
Doesn't it break jobs queued after the code change? |
I'm not sure! My original thought was that it would be ok because we didn't explicitly change any job method signatures ... but here's more research... Rails 7-0 branch, regular MessageDelivery enqueuing delivery -- https://github.com/rails/rails/blob/7-0-stable/actionmailer/lib/action_mailer/message_delivery.rb#L143 Same thing but in the parameterized class -- https://github.com/rails/rails/blob/7-0-stable/actionmailer/lib/action_mailer/parameterized.rb#L144 The parameterized version calls
So, I think maybe it is an issue. Is there typically a large backlog of mailer jobs? |
These methods were all pretty similar with a lot of common setup, so I extracted that into a parameterized setup using
with
when the mailer is called andbefore_action
s in the mailer to set i-vars.Also did some readability refactor in the spec and preview while in there.
If diff seems excessive - going one commit at a time is probably more sensical.
I think the Admin and User mailers both have similar opportunity and will do those after this if merged.