More flexible mail notifications settings at user level. A user has now 3 options:
* notification on any event on all his projects * notification on any event on selected projects only (if the user belongs to more than 1 project) * notification only for things that he watches or he is involded in (eg. issues that he watches or he is author or assignee) git-svn-id: http://redmine.rubyforge.org/svn/trunk@855 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
1 parent
eacd050630
commit
90d33c3e51
30 files changed
+254
-93
No files matched your search
+5
-17
@@ -30,13 +30,7 @@ class Mailer < ActionMailer::Base
|
||||
|
||||
def issue_add(issue)
|
||||
set_language_if_valid(Setting.default_language)
|
||||
# Sends to all project members
|
||||
@recipients = issue.project.members.collect { |m| m.user.mail if m.user.mail_notification }.compact
|
||||
# Sends to author and assignee (even if they turned off mail notification)
|
||||
@recipients << issue.author.mail if issue.author
|
||||
@recipients << issue.assigned_to.mail if issue.assigned_to
|
||||
@recipients.compact!
|
||||
@recipients.uniq!
|
||||
@recipients = issue.recipients
|
||||
@from = Setting.mail_from
|
||||
@subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] #{issue.status.name} - #{issue.subject}"
|
||||
@body['issue'] = issue
|
||||
@@ -44,14 +38,8 @@ class Mailer < ActionMailer::Base
|
||||
|
||||
def issue_edit(journal)
|
||||
set_language_if_valid(Setting.default_language)
|
||||
# Sends to all project members
|
||||
issue = journal.journalized
|
||||
@recipients = issue.project.members.collect { |m| m.user.mail if m.user.mail_notification }.compact
|
||||
# Sends to author and assignee (even if they turned off mail notification)
|
||||
@recipients << issue.author.mail if issue.author
|
||||
@recipients << issue.assigned_to.mail if issue.assigned_to
|
||||
@recipients.compact!
|
||||
@recipients.uniq!
|
||||
@recipients = issue.recipients
|
||||
# Watchers in cc
|
||||
@cc = issue.watcher_recipients - @recipients
|
||||
@from = Setting.mail_from
|
||||
@@ -62,7 +50,7 @@ class Mailer < ActionMailer::Base
|
||||
|
||||
def document_added(document)
|
||||
set_language_if_valid(Setting.default_language)
|
||||
@recipients = document.project.users.collect { |u| u.mail if u.mail_notification }.compact
|
||||
@recipients = document.project.recipients
|
||||
@from = Setting.mail_from
|
||||
@subject = "[#{document.project.name}] #{l(:label_document_new)}: #{document.title}"
|
||||
@body['document'] = document
|
||||
@@ -81,7 +69,7 @@ class Mailer < ActionMailer::Base
|
||||
url = {:only_path => false, :host => Setting.host_name, :controller => 'documents', :action => 'show', :id => container.id}
|
||||
added_to = "#{l(:label_document)}: #{container.title}"
|
||||
end
|
||||
@recipients = container.project.users.collect { |u| u.mail if u.mail_notification }.compact
|
||||
@recipients = container.project.recipients
|
||||
@from = Setting.mail_from
|
||||
@subject = "[#{container.project.name}] #{l(:label_attachment_new)}"
|
||||
@body['attachments'] = attachments
|
||||
@@ -91,7 +79,7 @@ class Mailer < ActionMailer::Base
|
||||
|
||||
def news_added(news)
|
||||
set_language_if_valid(Setting.default_language)
|
||||
@recipients = news.project.users.collect { |u| u.mail if u.mail_notification }.compact
|
||||
@recipients = news.project.recipients
|
||||
@from = Setting.mail_from
|
||||
@subject = "[#{news.project.name}] #{l(:label_news)}: #{news.title}"
|
||||
@body['news'] = news
|
||||
|
||||
Reference in new issue
Block a user