|
|
|
@ -517,13 +517,46 @@ class Mailer < ActionMailer::Base
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def forum_message_added(memo)
|
|
|
|
|
@memo = memo
|
|
|
|
|
redmine_headers 'Memo' => memo.id
|
|
|
|
|
@forum = memo.forum
|
|
|
|
|
@author = memo.author
|
|
|
|
|
@forum_url = url_for(:controller => 'forums', :action => 'show', :id => @forum.id)
|
|
|
|
|
@issue_author_url = url_for(user_activities_url(@author))
|
|
|
|
|
recipients ||= []
|
|
|
|
|
#将帖子创建者邮箱地址加入数组
|
|
|
|
|
recipients << @forum.creator.mail
|
|
|
|
|
#回复人邮箱地址加入数组
|
|
|
|
|
recipients << @author.mail
|
|
|
|
|
# cc = wiki_content.page.wiki.watcher_recipients - recipients
|
|
|
|
|
|
|
|
|
|
@memo_url = url_for(forum_memo_url(@forum, (@memo.parent_id.nil? ? @memo : @memo.parent_id)))
|
|
|
|
|
mail :to => recipients,
|
|
|
|
|
:subject => "[ #{l(:label_message_plural)} : #{memo.subject} #{l(:label_memo_create_succ)}]",
|
|
|
|
|
:filter => true
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# Builds a Mail::Message object used to email recipients of a course when an homework are posted.
|
|
|
|
|
#
|
|
|
|
|
# Example:
|
|
|
|
|
# attachments_added(attachments) => Mail::Message object
|
|
|
|
|
# Mailer.attachments_added(attachments).deliver => sends an email to the project's recipients
|
|
|
|
|
def homework_added
|
|
|
|
|
|
|
|
|
|
def homework_added(homework_common)
|
|
|
|
|
@homework_common = homework_common
|
|
|
|
|
@author = homework_common.user
|
|
|
|
|
@homework_common_url = url_for(:controller => "homework_common", :action =>"index", :homework => @homework_common.id)
|
|
|
|
|
@homework_author_url = url_for(user_activities_url(@author))
|
|
|
|
|
recipients ||= []
|
|
|
|
|
#将帖子创建者邮箱地址加入数组
|
|
|
|
|
@homework_common.course.members.each do |member|
|
|
|
|
|
recipients << member.user.mail
|
|
|
|
|
end
|
|
|
|
|
mail :to => recipients,
|
|
|
|
|
:subject => "[ #{l(:label_user_homework)} : #{homework_common.name} #{l(:label_memo_create_succ)}]",
|
|
|
|
|
:filter => true
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# Builds a Mail::Message object used to email recipients of a news' project when a news item is added.
|
|
|
|
|