From 848d6cd46b93ef9b1e755449a1de7cee56e7e115 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Tue, 19 Jan 2010 21:34:42 +0100 Subject: Mail should log when raise_delivery_methods is false. --- actionmailer/lib/action_mailer/base.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'actionmailer/lib/action_mailer/base.rb') 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 -- cgit v1.2.3