diff options
author | José Valim and Mikel Lindsaar <pair@programming.com> | 2010-01-24 12:30:13 +1100 |
---|---|---|
committer | José Valim and Mikel Lindsaar <pair@programming.com> | 2010-01-24 12:30:13 +1100 |
commit | afc758297c553de467b0c434330cb703d62795f1 (patch) | |
tree | d81ab5f36a62449eb6eb4c70c2f6ecf3d63c2759 /actionmailer/lib/action_mailer | |
parent | 258ca148004eaa63740ab2186338b3ac872b8187 (diff) | |
download | rails-afc758297c553de467b0c434330cb703d62795f1.tar.gz rails-afc758297c553de467b0c434330cb703d62795f1.tar.bz2 rails-afc758297c553de467b0c434330cb703d62795f1.zip |
Moving AS::Notifications call to one location in base
Diffstat (limited to 'actionmailer/lib/action_mailer')
-rw-r--r-- | actionmailer/lib/action_mailer/deprecated_api.rb | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/actionmailer/lib/action_mailer/deprecated_api.rb b/actionmailer/lib/action_mailer/deprecated_api.rb index a9ebd70f86..a2fa481d0e 100644 --- a/actionmailer/lib/action_mailer/deprecated_api.rb +++ b/actionmailer/lib/action_mailer/deprecated_api.rb @@ -83,19 +83,17 @@ module ActionMailer # email.set_some_obscure_header "frobnicate" # MyMailer.deliver(email) def deliver(mail) + return if @mail_was_called raise "no mail object available for delivery!" unless mail - ActiveSupport::Notifications.instrument("action_mailer.deliver", :mailer => self.name) do |payload| - self.set_payload_for_mail(payload, mail) + mail.register_for_delivery_notification(self) - mail.delivery_method delivery_methods[delivery_method], - delivery_settings[delivery_method] - - mail.raise_delivery_errors = raise_delivery_errors - mail.perform_deliveries = perform_deliveries - mail.deliver - end + mail.delivery_method delivery_methods[delivery_method], + delivery_settings[delivery_method] + mail.raise_delivery_errors = raise_delivery_errors + mail.perform_deliveries = perform_deliveries + mail.deliver mail end |