@@ -125,6 +125,24 ActionMailer::Base.add_delivery_method :async_smtp, DeliveryMethods::AsyncSMTP | |||
|
125 | 125 | ActionMailer::Base.add_delivery_method :async_sendmail, DeliveryMethods::AsyncSendmail |
|
126 | 126 | ActionMailer::Base.add_delivery_method :tmp_file, DeliveryMethods::TmpFile |
|
127 | 127 | |
|
128 | # Changes how sent emails are logged | |
|
129 | # Rails doesn't log cc and bcc which is misleading when using bcc only (#12090) | |
|
130 | module ActionMailer | |
|
131 | class LogSubscriber < ActiveSupport::LogSubscriber | |
|
132 | def deliver(event) | |
|
133 | recipients = [:to, :cc, :bcc].inject("") do |s, header| | |
|
134 | r = Array.wrap(event.payload[header]) | |
|
135 | if r.any? | |
|
136 | s << "\n #{header}: #{r.join(', ')}" | |
|
137 | end | |
|
138 | s | |
|
139 | end | |
|
140 | info("\nSent email \"#{event.payload[:subject]}\" (%1.fms)#{recipients}" % event.duration) | |
|
141 | debug(event.payload[:mail]) | |
|
142 | end | |
|
143 | end | |
|
144 | end | |
|
145 | ||
|
128 | 146 | module ActionController |
|
129 | 147 | module MimeResponds |
|
130 | 148 | class Collector |
General Comments 0
You need to be logged in to leave comments.
Login now