Skip to content

A platform for community discussion. Free, open, simple.

FIX: Change user digest email total unread notification calculation (#9648)

Martin Brennan4239ca1f8d17
diff --git a/app/mailers/user_notifications.rb b/app/mailers/user_notifications.rb
index 7b35e9b3e87..d1e883f4f4a 100644
--- a/app/mailers/user_notifications.rb
+++ b/app/mailers/user_notifications.rb
@@ -213,12 +213,12 @@ class UserNotifications < ActionMailer::Base
value: new_topics_count,
href: "#{Discourse.base_url}/new" }]
- value = user.unread_notifications
+ # totalling unread notifications (which are low-priority only) and unread
+ # PMs and bookmark reminder notifications, so the total is both unread low
+ # and high priority PMs
+ value = user.unread_notifications + user.unread_high_priority_notifications
@counts << { label_key: 'user_notifications.digest.unread_notifications', value: value, href: "#{Discourse.base_url}/my/notifications" } if value > 0
- value = user.unread_high_priority_notifications
- @counts << { label_key: 'user_notifications.digest.unread_high_priority', value: value, href: "#{Discourse.base_url}/my/notifications" } if value > 0
-
if @counts.size < 3
value = user.unread_notifications_of_type(Notification.types[:liked])
@counts << { label_key: 'user_notifications.digest.liked_received', value: value, href: "#{Discourse.base_url}/my/notifications" } if value > 0