From ace74974cf3575bbd3bf7ff4d8a83c3100fd22a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim=20and=20Mikel=20Lindsaar?= Date: Mon, 25 Jan 2010 21:47:03 +1100 Subject: Got AM working with Mail yield on delivery_handler and updated tests --- actionmailer/lib/action_mailer/base.rb | 9 +-------- actionmailer/lib/action_mailer/delivery_methods.rb | 4 ++-- 2 files changed, 3 insertions(+), 10 deletions(-) (limited to 'actionmailer/lib') diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 4e5e1bbb29..47d0ffaf68 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -330,14 +330,7 @@ module ActionMailer #:nodoc: ActiveSupport::Notifications.instrument("action_mailer.deliver") do |payload| self.set_payload_for_mail(payload, mail) - if mail.perform_deliveries - begin - mail.deliver! - rescue Exception => e - raise e if mail.raise_delivery_errors - end - Mail.deliveries << mail - end + yield # Let Mail do the delivery actions end end diff --git a/actionmailer/lib/action_mailer/delivery_methods.rb b/actionmailer/lib/action_mailer/delivery_methods.rb index 7a6b410932..34bfe6000a 100644 --- a/actionmailer/lib/action_mailer/delivery_methods.rb +++ b/actionmailer/lib/action_mailer/delivery_methods.rb @@ -40,8 +40,8 @@ module ActionMailer end module ClassMethods - # Provides a list of emails that have been delivered by Mail - delegate :deliveries, :deliveries=, :to => Mail + # Provides a list of emails that have been delivered by Mail::TestMailer + delegate :deliveries, :deliveries=, :to => Mail::TestMailer # Adds a new delivery method through the given class using the given symbol # as alias and the default options supplied: -- cgit v1.2.3