修改《发送多封相同邮件》

Signed-off-by: alan <547533434@qq.com>
This commit is contained in:
alan 2015-01-22 17:31:34 +08:00
parent 24dfeb1614
commit 8f1249390a
3 changed files with 10 additions and 5 deletions

View File

@ -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

View File

@ -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

View File

@ -12,7 +12,7 @@
<span style="float: left"><strong><%= l(:field_content)%></strong></span><span style="float: left; width: 540px"><%= @journal.notes %></span>
</div>
<div class="cl"></div>
<hr/>
<%= render :partial => 'issue', :formats => [:html], :locals => { :issue => @issue, :issue_url => @issue_url } %>
<div class="mail_foot"><%= link_to( l(:mail_issue_footer), @user_url) %> </div>