diff options
author | José Valim <jose.valim@plataformatec.com.br> | 2012-08-04 04:15:06 -0700 |
---|---|---|
committer | José Valim <jose.valim@plataformatec.com.br> | 2012-08-04 04:15:06 -0700 |
commit | 1935cfd07fde9bc6f3c60547aa85279869eaf804 (patch) | |
tree | bbd0eac2c4773e1a7eaa5ed26ed431bd685ccc46 /actionmailer/lib | |
parent | 067efad8af6e84e45518120a77dfbb0b49c94469 (diff) | |
parent | 7c8424e057b53cf12ce1c748b09601e720be6a09 (diff) | |
download | rails-1935cfd07fde9bc6f3c60547aa85279869eaf804.tar.gz rails-1935cfd07fde9bc6f3c60547aa85279869eaf804.tar.bz2 rails-1935cfd07fde9bc6f3c60547aa85279869eaf804.zip |
Merge pull request #7202 from asanghi/perform_deliveries_in_mail
Allow perform_deliveries to be set within mailer action
Diffstat (limited to 'actionmailer/lib')
-rw-r--r-- | actionmailer/lib/action_mailer/base.rb | 2 | ||||
-rw-r--r-- | actionmailer/lib/action_mailer/delivery_methods.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 900da9697e..73ac8ea12b 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -683,7 +683,7 @@ module ActionMailer #:nodoc: m.charset = charset = headers[:charset] # Set configure delivery behavior - wrap_delivery_behavior!(headers.delete(:delivery_method)) + wrap_delivery_behavior!(headers.delete(:delivery_method),headers.delete(:perform_deliveries)) # Assign all headers except parts_order, content_type and body assignable = headers.except(:parts_order, :content_type, :body, :template_name, :template_path) diff --git a/actionmailer/lib/action_mailer/delivery_methods.rb b/actionmailer/lib/action_mailer/delivery_methods.rb index 3b38dbccc7..0b8d0019eb 100644 --- a/actionmailer/lib/action_mailer/delivery_methods.rb +++ b/actionmailer/lib/action_mailer/delivery_methods.rb @@ -57,7 +57,7 @@ module ActionMailer self.delivery_methods = delivery_methods.merge(symbol.to_sym => klass).freeze end - def wrap_delivery_behavior(mail, method=nil) #:nodoc: + def wrap_delivery_behavior(mail, method=nil, perform_deliveries_header=nil) #:nodoc: method ||= self.delivery_method mail.delivery_handler = self @@ -74,7 +74,7 @@ module ActionMailer mail.delivery_method(method) end - mail.perform_deliveries = perform_deliveries + mail.perform_deliveries = perform_deliveries && (perform_deliveries_header.nil? || perform_deliveries_header) mail.raise_delivery_errors = raise_delivery_errors end end |