Skip to content
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

Mailer preview request model #21702

Closed

Conversation

@equivalent
Copy link
Contributor

commented Sep 21, 2015

Ability to pass Rails::MailersControlle params to ActionMailer::Preview instances (e.g. MyMailerPreview)

....I'm sorry, I've manage to screw-up upstream rebase of my original Pull request Mailer preview request model so here is the same PR updated with latest upstream

related discussion

@rails-bot

This comment has been minimized.

Copy link

commented Sep 21, 2015

Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @rafaelfranca (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.

@rails-bot

This comment has been minimized.

Copy link

commented Sep 21, 2015

warning Warning warning

  • Pull requests are usually filed against the master branch for this repo, but this one is against 4-2-stable. Please double check that you specified the right target!
@pixeltrix

This comment has been minimized.

Copy link
Member

commented Sep 21, 2015

I think if we were going to do anything we'd add a params to the preview instance that was available inside the method and not passed in. I like to think of previews as similar to controllers so each method is equivalent to an action. e.g:

class OrderMailerPreview < ActionMailer::Preview 
  def receipt
    OrderMailer.receipt(Order.find(params[:id]))
  end
end

I think anything else is straying too far into application level concerns.

@rafaelfranca

This comment has been minimized.

Copy link
Member

commented Sep 26, 2015

Could you please open the pull request with @pixeltrix's suggestion against the master branch? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.