|
|
|
@ -141,6 +141,19 @@ class Mailer < ActionMailer::Base
|
|
|
|
|
:subject => s
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 用户申请加入项目邮件通知
|
|
|
|
|
def applied_project(applied)
|
|
|
|
|
@project =applied.project
|
|
|
|
|
redmine_headers 'Project' => @project,
|
|
|
|
|
'User' => applied.user
|
|
|
|
|
@user = applied.user
|
|
|
|
|
recipients = @project.manager_recipients
|
|
|
|
|
s = l(:text_applied_project, :id => "##{@user.show_name}", :project => @project.name)
|
|
|
|
|
@applied_url = url_for(:controller => 'projects', :action => 'settings', :id => @project.id,:tab=>'members')
|
|
|
|
|
mail :to => recipients,
|
|
|
|
|
:subject => s
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def reminder(user, issues, days)
|
|
|
|
|
set_language_if_valid user.language
|
|
|
|
|
@issues = issues
|
|
|
|
@ -180,7 +193,11 @@ class Mailer < ActionMailer::Base
|
|
|
|
|
when 'Project'
|
|
|
|
|
added_to_url = url_for(:controller => 'files', :action => 'index', :project_id => container)
|
|
|
|
|
added_to = "#{l(:label_project)}: #{container}"
|
|
|
|
|
recipients = container.project.notified_users.select {|user| user.allowed_to?(:view_files, container.project)}.collect {|u| u.mail}
|
|
|
|
|
recipients = container.notified_users.select { |user| user.allowed_to?(:view_files, container) }.collect { |u| u.mail }
|
|
|
|
|
when 'Course'
|
|
|
|
|
added_to_url = url_for(:controller => 'files', :action => 'index', :course_id => container)
|
|
|
|
|
added_to = "#{l(:label_course)}: #{container}"
|
|
|
|
|
recipients = container.notified_users.select { |user| user.allowed_to?(:view_files, container) }.collect { |u| u.mail }
|
|
|
|
|
when 'Version'
|
|
|
|
|
added_to_url = url_for(:controller => 'files', :action => 'index', :project_id => container.project)
|
|
|
|
|
added_to = "#{l(:label_version)}: #{container.name}"
|
|
|
|
@ -190,6 +207,21 @@ class Mailer < ActionMailer::Base
|
|
|
|
|
added_to = "#{l(:label_document)}: #{container.title}"
|
|
|
|
|
recipients = container.recipients
|
|
|
|
|
end
|
|
|
|
|
if container.class.name == 'Course'
|
|
|
|
|
redmine_headers 'Course' => container.id
|
|
|
|
|
@attachments = attachments
|
|
|
|
|
@added_to = added_to
|
|
|
|
|
@added_to_url = added_to_url
|
|
|
|
|
mail :to => recipients,
|
|
|
|
|
:subject => "[#{container.name}] #{l(:label_attachment_new)}"
|
|
|
|
|
elsif container.class.name == 'Project'
|
|
|
|
|
redmine_headers 'Project' => container.id
|
|
|
|
|
@attachments = attachments
|
|
|
|
|
@added_to = added_to
|
|
|
|
|
@added_to_url = added_to_url
|
|
|
|
|
mail :to => recipients,
|
|
|
|
|
:subject => "[#{container.name}] #{l(:label_attachment_new)}"
|
|
|
|
|
else
|
|
|
|
|
redmine_headers 'Project' => container.project.identifier
|
|
|
|
|
@attachments = attachments
|
|
|
|
|
@added_to = added_to
|
|
|
|
@ -197,6 +229,7 @@ class Mailer < ActionMailer::Base
|
|
|
|
|
mail :to => recipients,
|
|
|
|
|
:subject => "[#{container.project.name}] #{l(:label_attachment_new)}"
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# Builds a Mail::Message object used to email recipients of a news' project when a news item is added.
|
|
|
|
|
#
|
|
|
|
|