From 06b135456c68b674bfa5e6a83e02b320c3920d7e Mon Sep 17 00:00:00 2001
From: Cont Deploy <contDeploy@uibk.ac.at>
Date: Wed, 31 May 2023 13:24:46 +0200
Subject: [PATCH] log mail sending

---
 .../uibk/gitsearch/service/ReviewService.java | 20 ++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/src/main/java/at/ac/uibk/gitsearch/service/ReviewService.java b/src/main/java/at/ac/uibk/gitsearch/service/ReviewService.java
index 2aa495cfa..fb734688f 100644
--- a/src/main/java/at/ac/uibk/gitsearch/service/ReviewService.java
+++ b/src/main/java/at/ac/uibk/gitsearch/service/ReviewService.java
@@ -409,13 +409,19 @@ public class ReviewService {
         reviewRepository.save(review);
 
         for (User u : authorityService.findAllUsersWithAuthority("ROLE_REVIEW_MANAGER")) {
-            mailService.sendEmail(
-                u.getEmail(),
-                "NEW REVIEW REQUESTED",
-                userO.get().getEmail() + " requested a review for " + request.getResource(),
-                false,
-                false
-            );
+            if (
+                mailService.sendEmail(
+                    u.getEmail(),
+                    "NEW REVIEW REQUESTED",
+                    userO.get().getEmail() + " requested a review for " + request.getResource(),
+                    false,
+                    false
+                )
+            ) {
+                LOGGER.info("Sent mail to " + u.getEmail());
+            } else {
+                LOGGER.warn("Failed to send mail to " + u.getEmail());
+            }
         }
     }
 
-- 
GitLab