From 8f1249390a46a1804fc8bd659cdbc451f070a741 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Thu, 22 Jan 2015 17:31:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E3=80=8A=E5=8F=91=E9=80=81?= =?UTF-8?q?=E5=A4=9A=E5=B0=81=E7=9B=B8=E5=90=8C=E9=82=AE=E4=BB=B6=E3=80=8B?= =?UTF-8?q?=20Signed-off-by:=20alan=20<547533434@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/mailer.rb | 11 ++++++++--- app/models/project.rb | 2 +- app/views/mailer/issue_edit.html.erb | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 02684a187..23ac36054 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -147,8 +147,10 @@ class Mailer < ActionMailer::Base @project_url = url_for(:controller => 'projects', :action => 'show', :id => issue.project_id, :token => @token.value) @user_url = url_for(my_account_url(user,:token => @token.value)) - - cc = issue.watcher_recipients - issue.recipients + cc = nil + if recipients == issue.recipients[0] + cc = issue.watcher_recipients - issue.recipients + end subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue_id}] (#{issue.status.name}) #{issue.subject}" mail(:to => recipients, :cc => cc, @@ -197,8 +199,11 @@ class Mailer < ActionMailer::Base # Watchers in cc + cc = nil + if recipients == journal.recipients[0] + cc = journal.watcher_recipients - journal.recipients + end - cc = journal.watcher_recipients - journal.recipients s = "[#{issue.project.name} - #{issue.tracker.name} ##{issue_id}] " s << "(#{issue.status.name}) " if journal.new_value_for('status_id') s << issue.subject diff --git a/app/models/project.rb b/app/models/project.rb index 01e6cd91c..14763347f 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -600,7 +600,7 @@ class Project < ActiveRecord::Base # Returns the users that should be notified on project events def notified_users # TODO: User part should be extracted to User#notify_about? - members.select {|m| m.principal.present? && (m.mail_notification? || m.principal.mail_notification == 'all' || m.principal.mail_notification == 'only_my_events' ||m.principal.mail_notification == 'selected')}.collect {|m| m.principal} + members.select {|m| m.principal.present? && (m.mail_notification? || m.principal.mail_notification == 'all')}.collect {|m| m.principal} end # Returns an array of all custom fields enabled for project issues diff --git a/app/views/mailer/issue_edit.html.erb b/app/views/mailer/issue_edit.html.erb index 6fcb0ddb5..af167cff5 100644 --- a/app/views/mailer/issue_edit.html.erb +++ b/app/views/mailer/issue_edit.html.erb @@ -12,7 +12,7 @@ <%= l(:field_content)%>:<%= @journal.notes %>
-