From d14f23497ccf751d445708eccbf61ba3011f69c5 Mon Sep 17 00:00:00 2001
From: Alex <alex.tran1502@gmail.com>
Date: Tue, 11 Jun 2024 03:51:58 -0500
Subject: [PATCH] fix(server): album update disable no effect (#10090)

---
 server/src/services/notification.service.ts | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/server/src/services/notification.service.ts b/server/src/services/notification.service.ts
index dab9dd91b3..3aec2e04f3 100644
--- a/server/src/services/notification.service.ts
+++ b/server/src/services/notification.service.ts
@@ -182,7 +182,12 @@ export class NotificationService {
     const { server } = await this.configCore.getConfig();
 
     for (const recipient of recipients) {
-      const { emailNotifications } = getPreferences(recipient);
+      const user = await this.userRepository.get(recipient.id, { withDeleted: false });
+      if (!user) {
+        continue;
+      }
+
+      const { emailNotifications } = getPreferences(user);
 
       if (!emailNotifications.enabled || !emailNotifications.albumUpdate) {
         continue;