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
Pass request params to ActionMailer::Preview #25193
Conversation
Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @sgrif (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. Please see the contribution instructions for more information. |
This is mostly a discussion starter. So if this is "acceptable" idea, I will add specs for changes. |
cc @pixeltrix There was some interest in having this feature. |
I'm also very interested in this - essentially a solution to #21702 with @pixeltrix's suggestion. @ixti - have you written specs for this change? |
571fbe7
to
b88e40b
Compare
BaseMailerPreview.call(:welcome, params) | ||
end | ||
end | ||
end |
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.
I'm not sure of the worth of this test as it stands - I think it needs breaking out into a separate preview test case file and then actually testing the content of params changes the output. I know that the railties test does that but we should probably have a unit test that does it as well because not everyone runs the railties tests 😉
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.
Do you propose to extract that into a separate file? I'm not sure I fully understand your proposal.
Shouldn't the railties template be updated so that the params are passed into the iframe. Otherwise the body of the message won't get the same params... |
@eric1234 Oh. Indeed! Thanks! Will fix that! |
@ixti - Also the dropdown that selects the part being viewed. |
@eric1234 thanks again. I really completely forgot about views :D |
b88e40b
to
9ee9349
Compare
@eric1234 fixed view templates and extended test to cover that. |
1113169
to
c537f52
Compare
c537f52
to
28e388a
Compare
@sgrif I have rebased PR upon master. Still waiting for a review. If there's no interest in this PR, please, close it. |
I'm on parental leave for the next few months. I'll defer to someone else on this. r? @pixeltrix |
Is there still any interest in this PR? @pixeltrix |
I assume silence and ignore means no interest. |
Allows passing query params to email previews: