summaryrefslogtreecommitdiffstats
path: root/app/models/mailer.rb
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2022-02-23 21:16:18 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2022-02-23 21:16:18 +0000
commitba74ba1c702e7a122328094341e659c2baf9fd3d (patch)
treeb6d43d8beaf9538ff54bebd16768f29f7ef782a6 /app/models/mailer.rb
parent3a6c43deeec8f9f444008e43f53e58a6614716ed (diff)
downloadredmine-ba74ba1c702e7a122328094341e659c2baf9fd3d.tar.gz
redmine-ba74ba1c702e7a122328094341e659c2baf9fd3d.zip
Allow users to be mentioned using @ in issues and wiki pages (#13919):
* the user must have add watchers permission on that object in order to mention other users * mentioned user will receive a notification email * only visible users who can view the object can be mentioned git-svn-id: http://svn.redmine.org/redmine/trunk@21435 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/mailer.rb')
-rw-r--r--app/models/mailer.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/models/mailer.rb b/app/models/mailer.rb
index cdf7aedba..3007350b7 100644
--- a/app/models/mailer.rb
+++ b/app/models/mailer.rb
@@ -94,7 +94,7 @@ class Mailer < ActionMailer::Base
# Example:
# Mailer.deliver_issue_add(issue)
def self.deliver_issue_add(issue)
- users = issue.notified_users | issue.notified_watchers
+ users = issue.notified_users | issue.notified_watchers | issue.notified_mentions
users.each do |user|
issue_add(user, issue).deliver_later
end
@@ -129,7 +129,7 @@ class Mailer < ActionMailer::Base
# Example:
# Mailer.deliver_issue_edit(journal)
def self.deliver_issue_edit(journal)
- users = journal.notified_users | journal.notified_watchers
+ users = journal.notified_users | journal.notified_watchers | journal.notified_mentions | journal.journalized.notified_mentions
users.select! do |user|
journal.notes? || journal.visible_details(user).any?
end
@@ -306,7 +306,7 @@ class Mailer < ActionMailer::Base
# Example:
# Mailer.deliver_wiki_content_added(wiki_content)
def self.deliver_wiki_content_added(wiki_content)
- users = wiki_content.notified_users | wiki_content.page.wiki.notified_watchers
+ users = wiki_content.notified_users | wiki_content.page.wiki.notified_watchers | wiki_content.notified_mentions
users.each do |user|
wiki_content_added(user, wiki_content).deliver_later
end
@@ -343,6 +343,7 @@ class Mailer < ActionMailer::Base
users = wiki_content.notified_users
users |= wiki_content.page.notified_watchers
users |= wiki_content.page.wiki.notified_watchers
+ users |= wiki_content.notified_mentions
users.each do |user|
wiki_content_updated(user, wiki_content).deliver_later