From 4239ca1f8d172f6a5c8342996ceefe9887f7a263 Mon Sep 17 00:00:00 2001 From: Martin Brennan Date: Wed, 6 May 2020 14:23:13 +1000 Subject: [PATCH] FIX: Change user digest email total unread notification calculation (#9648) We now add together unread notifications (which are low-priority only) and unread high priority notifications (PMs and bookmark reminder notifications), and removed the separate "X unread high priority notifications" count in the user digest email. --- app/mailers/user_notifications.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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