diff options
author | hnatt <hnatt88@gmail.com> | 2015-10-29 21:58:27 +0200 |
---|---|---|
committer | hnatt <hnatt88@gmail.com> | 2015-10-29 21:58:27 +0200 |
commit | 4b65e5058e726af9ae02e2e0a65e6b5e1a1628ec (patch) | |
tree | 9790a5b7477864bbfd82ea1e802b35ed1ea461bb /actionmailer | |
parent | 79b6a4bbc4d8a209363c33df79caeea462f6dde6 (diff) | |
download | rails-4b65e5058e726af9ae02e2e0a65e6b5e1a1628ec.tar.gz rails-4b65e5058e726af9ae02e2e0a65e6b5e1a1628ec.tar.bz2 rails-4b65e5058e726af9ae02e2e0a65e6b5e1a1628ec.zip |
Refactor out headers to message assignment from ActionMailer::Base#mail
Diffstat (limited to 'actionmailer')
-rw-r--r-- | actionmailer/lib/action_mailer/base.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index d0d3c21a15..a90279d578 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -808,9 +808,7 @@ module ActionMailer # Set configure delivery behavior wrap_delivery_behavior!(headers.delete(:delivery_method), headers.delete(:delivery_method_options)) - # Assign all headers except parts_order, content_type, body, template_name, and template_path - assignable = headers.except(:parts_order, :content_type, :body, :template_name, :template_path) - assignable.each { |k, v| message[k] = v } + assign_headers_to_message(headers) # Render the templates and blocks responses = collect_responses(headers, &block) @@ -844,6 +842,11 @@ module ActionMailer end private :apply_defaults + def assign_headers_to_message(headers) + assignable = headers.except(:parts_order, :content_type, :body, :template_name, :template_path) + assignable.each { |k, v| message[k] = v } + end + protected # Used by #mail to set the content type of the message. |