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 %>
-
+ <%= render :partial => 'issue', :formats => [:html], :locals => { :issue => @issue, :issue_url => @issue_url } %>
<%= link_to( l(:mail_issue_footer), @user_url) %>