diff options
author | Alexey Zapparov <ixti@member.fsf.org> | 2016-05-30 02:15:18 +0200 |
---|---|---|
committer | Alexey Zapparov <ixti@member.fsf.org> | 2017-03-01 20:54:14 +0100 |
commit | 8e6c6d854cdedad4bc082cf45a01d411ea26fb68 (patch) | |
tree | 8cefc1e555df79e53b17915e093f8070c15acd93 /actionmailer/lib | |
parent | b61a56541aecd7ac685d4f19d943177a3f1b465a (diff) | |
download | rails-8e6c6d854cdedad4bc082cf45a01d411ea26fb68.tar.gz rails-8e6c6d854cdedad4bc082cf45a01d411ea26fb68.tar.bz2 rails-8e6c6d854cdedad4bc082cf45a01d411ea26fb68.zip |
Pass request params to ActionMailer::Preview
Diffstat (limited to 'actionmailer/lib')
-rw-r--r-- | actionmailer/lib/action_mailer/preview.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/actionmailer/lib/action_mailer/preview.rb b/actionmailer/lib/action_mailer/preview.rb index b0152aff03..87ba743f3d 100644 --- a/actionmailer/lib/action_mailer/preview.rb +++ b/actionmailer/lib/action_mailer/preview.rb @@ -52,6 +52,12 @@ module ActionMailer class Preview extend ActiveSupport::DescendantsTracker + attr_reader :params + + def initialize(params = {}) + @params = params + end + class << self # Returns all mailer preview classes. def all @@ -62,8 +68,8 @@ module ActionMailer # Returns the mail object for the given email name. The registered preview # interceptors will be informed so that they can transform the message # as they would if the mail was actually being delivered. - def call(email) - preview = new + def call(email, params = {}) + preview = new(params) message = preview.public_send(email) inform_preview_interceptors(message) message |