Mail notification options restored (default is: issue_added and issue_updated).
Added mail notification when adding a news (disabled by default). git-svn-id: http://redmine.rubyforge.org/svn/trunk@728 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -187,7 +187,7 @@ class ProjectsController < ApplicationController
|
||||
Attachment.create(:container => @document, :file => a, :author => logged_in_user) unless a.size == 0
|
||||
} if params[:attachments] and params[:attachments].is_a? Array
|
||||
flash[:notice] = l(:notice_successful_create)
|
||||
Mailer.deliver_document_add(@document) #if Permission.find_by_controller_and_action(params[:controller], params[:action]).mail_enabled?
|
||||
Mailer.deliver_document_add(@document) if Setting.notified_events.include?('document_added')
|
||||
redirect_to :action => 'list_documents', :id => @project
|
||||
end
|
||||
end
|
||||
@@ -231,7 +231,7 @@ class ProjectsController < ApplicationController
|
||||
if @issue.save
|
||||
@attachments.each(&:save)
|
||||
flash[:notice] = l(:notice_successful_create)
|
||||
Mailer.deliver_issue_add(@issue) #if Permission.find_by_controller_and_action(params[:controller], params[:action]).mail_enabled?
|
||||
Mailer.deliver_issue_add(@issue) if Setting.notified_events.include?('issue_added')
|
||||
redirect_to :action => 'list_issues', :id => @project
|
||||
end
|
||||
end
|
||||
@@ -380,6 +380,7 @@ class ProjectsController < ApplicationController
|
||||
@news.author_id = self.logged_in_user.id if self.logged_in_user
|
||||
if @news.save
|
||||
flash[:notice] = l(:notice_successful_create)
|
||||
Mailer.deliver_news_added(@news) if Setting.notified_events.include?('news_added')
|
||||
redirect_to :action => 'list_news', :id => @project
|
||||
end
|
||||
end
|
||||
@@ -405,7 +406,7 @@ class ProjectsController < ApplicationController
|
||||
a = Attachment.create(:container => @version, :file => file, :author => logged_in_user)
|
||||
@attachments << a unless a.new_record?
|
||||
} if params[:attachments] and params[:attachments].is_a? Array
|
||||
Mailer.deliver_attachments_add(@attachments) if !@attachments.empty? #and Permission.find_by_controller_and_action(params[:controller], params[:action]).mail_enabled?
|
||||
Mailer.deliver_attachments_add(@attachments) if !@attachments.empty? && Setting.notified_events.include?('file_added')
|
||||
redirect_to :controller => 'projects', :action => 'list_files', :id => @project
|
||||
end
|
||||
@versions = @project.versions.sort
|
||||
|
||||
Reference in New Issue
Block a user