Class: ActionMailer::LogSubscriber

Inherits:
ActiveSupport::LogSubscriber
  • Object
show all
Defined in:
lib/action_mailer/log_subscriber.rb

Instance Method Summary collapse

Instance Method Details

#deliver(event) ⇒ Object



5
6
7
8
9
# File 'lib/action_mailer/log_subscriber.rb', line 5

def deliver(event)
  recipients = Array.wrap(event.payload[:to]).join(', ')
  info("\nSent mail to #{recipients} (%1.fms)" % event.duration)
  debug(event.payload[:mail])
end

#loggerObject



16
17
18
# File 'lib/action_mailer/log_subscriber.rb', line 16

def logger
  ActionMailer::Base.logger
end

#receive(event) ⇒ Object



11
12
13
14
# File 'lib/action_mailer/log_subscriber.rb', line 11

def receive(event)
  info("\nReceived mail (%.1fms)" % event.duration)
  debug(event.payload[:mail])
end