diff options
author | Mikel Lindsaar <raasdnil@gmail.com> | 2010-01-20 21:58:22 +1100 |
---|---|---|
committer | Mikel Lindsaar <raasdnil@gmail.com> | 2010-01-20 21:58:22 +1100 |
commit | 8b37fee201bb3f41d3bc4557422c5f8b344f456c (patch) | |
tree | 5c24f3f85f10976b3407f557517dcccf0343cd72 /actionmailer/lib/action_mailer | |
parent | c04baed627c85e586e337896d64f61f397554a46 (diff) | |
parent | 8a1be228491f433fa8d20be4f485e2159f5ebe59 (diff) | |
download | rails-8b37fee201bb3f41d3bc4557422c5f8b344f456c.tar.gz rails-8b37fee201bb3f41d3bc4557422c5f8b344f456c.tar.bz2 rails-8b37fee201bb3f41d3bc4557422c5f8b344f456c.zip |
Merge branch 'master' of git://github.com/rails/rails
Conflicts:
actionmailer/lib/action_mailer/base.rb
Diffstat (limited to 'actionmailer/lib/action_mailer')
-rw-r--r-- | actionmailer/lib/action_mailer/base.rb | 17 | ||||
-rw-r--r-- | actionmailer/lib/action_mailer/railties/subscriber.rb | 8 | ||||
-rw-r--r-- | actionmailer/lib/action_mailer/test_case.rb | 2 |
3 files changed, 14 insertions, 13 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index be6d93316f..e105beef63 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -410,21 +410,22 @@ module ActionMailer #:nodoc: def deliver(mail) raise "no mail object available for delivery!" unless mail - begin - ActiveSupport::Notifications.instrument("action_mailer.deliver", :mailer => self.name) do |payload| - set_payload_for_mail(payload, mail) + ActiveSupport::Notifications.instrument("action_mailer.deliver", :mailer => self.name) do |payload| - # TODO Move me to the instance - mail.delivery_method delivery_methods[delivery_method], - delivery_settings[delivery_method] + self.set_payload_for_mail(payload, mail) + + mail.delivery_method delivery_methods[delivery_method], + delivery_settings[delivery_method] + begin + # TODO Move me to the instance if @@perform_deliveries mail.deliver! self.deliveries << mail end + rescue Exception => e # Net::SMTP errors or sendmail pipe errors + raise e if raise_delivery_errors end - rescue Exception => e # Net::SMTP errors or sendmail pipe errors - raise e if raise_delivery_errors end mail diff --git a/actionmailer/lib/action_mailer/railties/subscriber.rb b/actionmailer/lib/action_mailer/railties/subscriber.rb index af9c477237..cff852055c 100644 --- a/actionmailer/lib/action_mailer/railties/subscriber.rb +++ b/actionmailer/lib/action_mailer/railties/subscriber.rb @@ -3,13 +3,13 @@ module ActionMailer class Subscriber < Rails::Subscriber def deliver(event) recipients = Array(event.payload[:to]).join(', ') - info("Sent mail to #{recipients} (%1.fms)" % event.duration) - debug("\n#{event.payload[:mail]}") + info("\nSent mail to #{recipients} (%1.fms)" % event.duration) + debug(event.payload[:mail]) end def receive(event) - info("Received mail (%.1fms)" % event.duration) - debug("\n#{event.payload[:mail]}") + info("\nReceived mail (%.1fms)" % event.duration) + debug(event.payload[:mail]) end def logger diff --git a/actionmailer/lib/action_mailer/test_case.rb b/actionmailer/lib/action_mailer/test_case.rb index 318a1e46d1..0ca4f5494e 100644 --- a/actionmailer/lib/action_mailer/test_case.rb +++ b/actionmailer/lib/action_mailer/test_case.rb @@ -56,7 +56,7 @@ module ActionMailer end def read_fixture(action) - IO.readlines(File.join(RAILS_ROOT, 'test', 'fixtures', self.class.mailer_class.name.underscore, action)) + IO.readlines(File.join(Rails.root, 'test', 'fixtures', self.class.mailer_class.name.underscore, action)) end end end |