Issue截止时间到了邮件提醒
This commit is contained in:
parent
7b76514513
commit
524e152b24
|
@ -379,6 +379,16 @@ class Mailer < ActionMailer::Base
|
|||
|
||||
end
|
||||
|
||||
# issue截止时间提醒
|
||||
def issue_due_date(issue, recipients)
|
||||
@author = issue.author.login
|
||||
@issue_name = issue.subject
|
||||
@issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue.id)
|
||||
@subject = "#{l(:mail_issue)}#{issue.name} #{l(:mail_issue_due_date)} "
|
||||
mail :to => recipients,
|
||||
:subject => @subject
|
||||
end
|
||||
|
||||
# Builds a Mail::Message object used to email recipients of the added issue.
|
||||
#
|
||||
# Example:
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
<div class="mail_box" style="border:1px solid #c8c8c8; width:570px; height: auto; padding:15px; margin-top:10px; margin-bottom:10px;">
|
||||
<ul style="list-style-type:none; margin:0; padding:0;">
|
||||
<li style="list-style-type:none; margin:0; padding:0;"><span style="float: left;"><strong><%= l(:mail_issue_content)%></strong></span>
|
||||
<span style="float: left; width: 526px">
|
||||
<p><%=link_to @author, user_url(@author) %> 发布的问题跟踪:<%=link_to @issue_name, @issue_url %> <span style="color: red">截止时间快到了,请您关注!</span></p>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="cl" style="margin-top: 30px; clear:both; overflow:hidden;"></div>
|
||||
</div>
|
|
@ -28,4 +28,6 @@ zh:
|
|||
mail_homework: "作业:"
|
||||
mail_anonymous_comment_close: "作业匿评已经关闭,请您关注!"
|
||||
mail_anonymous_comment_open: "作业匿评已经开启,请您关注!"
|
||||
mail_anonymous_comment_failed: "作业匿评开启失败,请您关注!"
|
||||
mail_anonymous_comment_failed: "作业匿评开启失败,请您关注!"
|
||||
mail_issue_due_date: "问题跟踪截止时间快到了,请您关注!"
|
||||
mail_issue: "问题跟踪:"
|
|
@ -12,8 +12,8 @@ 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)
|
||||
# 发送邮件通知
|
||||
# Mailer.homework_endtime__added(homework_common, s.student_id).deliver
|
||||
# issue截止时间邮件提醒
|
||||
Mailer.issue_due_date(issue, recipients).deliver
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue