diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2010-01-24 01:33:18 +0530 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2010-01-24 01:33:18 +0530 |
commit | efd0bd3b7390ebb8526b981169025f2860f6a113 (patch) | |
tree | 1cb3bcd8f9534f64e8a764af1010ce65303b42b0 /actionmailer/lib/action_mailer | |
parent | f4571e3617ccd9cc9e5ee9f7431066bd80395e22 (diff) | |
parent | 8ff2fb6f3aa6140f5a8bd018d5919a8a1e707cda (diff) | |
download | rails-efd0bd3b7390ebb8526b981169025f2860f6a113.tar.gz rails-efd0bd3b7390ebb8526b981169025f2860f6a113.tar.bz2 rails-efd0bd3b7390ebb8526b981169025f2860f6a113.zip |
Merge remote branch 'mainstream/master'
Diffstat (limited to 'actionmailer/lib/action_mailer')
-rw-r--r-- | actionmailer/lib/action_mailer/base.rb | 14 | ||||
-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, 13 insertions, 11 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index a8233512ab..356861b591 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -524,14 +524,16 @@ module ActionMailer #:nodoc: def deliver!(mail = @mail) raise "no mail object available for delivery!" unless mail - begin - ActiveSupport::Notifications.instrument("action_mailer.deliver", - :template => template, :mailer => self.class.name) do |payload| - self.class.set_payload_for_mail(payload, mail) + ActiveSupport::Notifications.instrument("action_mailer.deliver", + :template => template, :mailer => self.class.name) do |payload| + + self.class.set_payload_for_mail(payload, mail) + + begin self.delivery_method.perform_delivery(mail) if perform_deliveries + 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 |