From bc060b31ae086db5a6baf6e3a892c525b2b6f0cd Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 2 Dec 2007 13:52:16 +0000 Subject: Email notifications are now sent as Blind carbon copy by default. This can be changed in email notifications settings (new setting added). Emission email address setting moved to the email notifications settings view. git-svn-id: http://redmine.rubyforge.org/svn/trunk@944 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/mailer.rb | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'app/models/mailer.rb') diff --git a/app/models/mailer.rb b/app/models/mailer.rb index fe432e9a6..9639e1a9c 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -129,11 +129,20 @@ class Mailer < ActionMailer::Base default_url_options[:protocol] = Setting.protocol end - # Overrides the create_mail method to remove the current user from the recipients and cc - # if he doesn't want to receive notifications about what he does + # Overrides the create_mail method def create_mail - recipients.delete(User.current.mail) if recipients && User.current.pref[:no_self_notified] - cc.delete(User.current.mail) if cc && User.current.pref[:no_self_notified] + # Removes the current user from the recipients and cc + # if he doesn't want to receive notifications about what he does + if User.current.pref[:no_self_notified] + recipients.delete(User.current.mail) if recipients + cc.delete(User.current.mail) if cc + end + # Blind carbon copy recipients + if Setting.bcc_recipients? + bcc([recipients, cc].flatten.compact.uniq) + recipients [] + cc [] + end super end -- cgit v1.2.3