Sha256: c0c29fe21c4ac6190b8b979b8f37a367d558ef775346144e58ced6a5488b597e
Contents?: true
Size: 581 Bytes
Versions: 30
Compression:
Stored size: 581 Bytes
Contents
module ActionMailer class LogSubscriber < ActiveSupport::LogSubscriber def deliver(event) return unless logger.info? recipients = Array(event.payload[:to]).join(', ') info("\nSent mail to #{recipients} (#{event.duration.round(1)}ms)") debug(event.payload[:mail]) end def receive(event) return unless logger.info? info("\nReceived mail (#{event.duration.round(1)}ms)") debug(event.payload[:mail]) end def logger ActionMailer::Base.logger end end end ActionMailer::LogSubscriber.attach_to :action_mailer
Version data entries
30 entries across 30 versions & 2 rubygems