From 31804b3d4598c02a6881a23a8025998f4d33b6ab Mon Sep 17 00:00:00 2001 From: z9hang Date: Wed, 28 May 2014 11:10:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E9=82=AE=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/mailer.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/models/mailer.rb b/app/models/mailer.rb index e5ede6285..a303d92bf 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -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}")