mirror of
https://github.com/redmine/redmine.git
synced 2024-08-27 05:58:46 +02:00
Adds cc and bcc to email log messages (#12090).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10683 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
82eab51203
commit
f09be68323
@ -125,6 +125,24 @@ ActionMailer::Base.add_delivery_method :async_smtp, DeliveryMethods::AsyncSMTP
|
|||||||
ActionMailer::Base.add_delivery_method :async_sendmail, DeliveryMethods::AsyncSendmail
|
ActionMailer::Base.add_delivery_method :async_sendmail, DeliveryMethods::AsyncSendmail
|
||||||
ActionMailer::Base.add_delivery_method :tmp_file, DeliveryMethods::TmpFile
|
ActionMailer::Base.add_delivery_method :tmp_file, DeliveryMethods::TmpFile
|
||||||
|
|
||||||
|
# Changes how sent emails are logged
|
||||||
|
# Rails doesn't log cc and bcc which is misleading when using bcc only (#12090)
|
||||||
|
module ActionMailer
|
||||||
|
class LogSubscriber < ActiveSupport::LogSubscriber
|
||||||
|
def deliver(event)
|
||||||
|
recipients = [:to, :cc, :bcc].inject("") do |s, header|
|
||||||
|
r = Array.wrap(event.payload[header])
|
||||||
|
if r.any?
|
||||||
|
s << "\n #{header}: #{r.join(', ')}"
|
||||||
|
end
|
||||||
|
s
|
||||||
|
end
|
||||||
|
info("\nSent email \"#{event.payload[:subject]}\" (%1.fms)#{recipients}" % event.duration)
|
||||||
|
debug(event.payload[:mail])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
module ActionController
|
module ActionController
|
||||||
module MimeResponds
|
module MimeResponds
|
||||||
class Collector
|
class Collector
|
||||||
|
Loading…
Reference in New Issue
Block a user