发邮件

This commit is contained in:
z9hang 2014-05-28 11:10:31 +08:00
parent 306ae9f685
commit 31804b3d45
1 changed files with 11 additions and 1 deletions

View File

@ -22,7 +22,7 @@ class Mailer < ActionMailer::Base
helper :custom_fields
include Redmine::I18n
include CoursesHelper
def self.default_url_options
{ :host => Setting.host_name, :protocol => Setting.protocol }
end
@ -44,6 +44,16 @@ class Mailer < ActionMailer::Base
when :Bid
respond_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
when :Project
if journals_for_message.jour.project_type == 1
project = journals_for_message.jour
@teachers = searchTeacherAndAssistant journals_for_message.jour
@recipients ||= []
@teachers.each do |teacher|
@recipients << teacher
end
mail :to => @recipients,
:subject => "您的课程#{journals_for_message.jour.name}中有了新的留言"
end
project_feedback_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
when :Contest
show_contest_contest_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")