From a0364deb6a11b261424b19e1d9788a9b7be1ee83 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 31 Jan 2010 11:00:40 +0000 Subject: [PATCH] Log info when sending an email notification. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3355 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/mailer.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 9c409af6..b16b6a1c 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -340,9 +340,14 @@ class Mailer < ActionMailer::Base recipients.delete(@author.mail) if recipients cc.delete(@author.mail) if cc end + + notified_users = [recipients, cc].flatten.compact.uniq + # Rails would log recipients only, not cc and bcc + mylogger.info "Sending email notification to: #{notified_users.join(', ')}" if mylogger + # Blind carbon copy recipients if Setting.bcc_recipients? - bcc([recipients, cc].flatten.compact.uniq) + bcc(notified_users) recipients [] cc [] end @@ -393,6 +398,10 @@ class Mailer < ActionMailer::Base @references_objects ||= [] @references_objects << object end + + def mylogger + RAILS_DEFAULT_LOGGER + end end # Patch TMail so that message_id is not overwritten