diff options
Diffstat (limited to 'actionmailer/lib/action_mailer/railties')
-rw-r--r-- | actionmailer/lib/action_mailer/railties/subscriber.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/actionmailer/lib/action_mailer/railties/subscriber.rb b/actionmailer/lib/action_mailer/railties/subscriber.rb new file mode 100644 index 0000000000..aafc155b09 --- /dev/null +++ b/actionmailer/lib/action_mailer/railties/subscriber.rb @@ -0,0 +1,20 @@ +module ActionMailer + module Railties + class Subscriber < Rails::Subscriber + def deliver(event) + recipients = Array(event.payload[:mailer].recipients).join(', ') + info("Sent mail to #{recipients} (%1.fms)" % event.duration) + debug("\n#{event.payload[:mail].encoded}") + end + + def receive(event) + info("Received mail (%.1fms)" % event.duration) + debug("\n#{event.payload[:mail].encoded}") + end + + def logger + ActionMailer::Base.logger + end + end + end +end
\ No newline at end of file |