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