issue截止时间邮件通知

This commit is contained in:
huang 2016-01-22 20:26:44 +08:00
parent 29c49fbb0c
commit 655cc0d2db
3 changed files with 11 additions and 3 deletions

View File

@ -380,7 +380,15 @@ class Mailer < ActionMailer::Base
end
# issue截止时间提醒
def issue_due_date(issue, recipients)
def issue_due_date(issue)
recipients ||= []
if issue.author.id != issue.assigned_to_id
recipients << issue.author.mail
end
# 被指派人邮箱地址加入数组
recipients << issue.assigned_to.mail
# cc = wiki_content.page.wiki.watcher_recipients - recipients
@author = issue.author
@issue_name = issue.subject
@issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue.id)

View File

View File

@ -14,10 +14,10 @@ namespace :issue_due_date do
recipients << assigner
recipients.each do |r|
issue.forge_messages << ForgeMessage.new(:user_id => r.id, :project_id => issue.project_id, :viewed => false, :status => 1)
# issue截止时间邮件提醒
Mailer.issue_due_date(issue, recipients).deliver
end
end
# issue截止时间邮件提醒
Mailer.issue_due_date(issue).deliver
end
end
end