From a0364deb6a11b261424b19e1d9788a9b7be1ee83 2010-01-31 11:00:40 From: Jean-Philippe Lang Date: 2010-01-31 11:00:40 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 --- diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 9c409af..b16b6a1 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