From d83041eb3be97414df66dd30cbd01816417e82c1 Mon Sep 17 00:00:00 2001 From: nek0 Date: Fri, 15 Apr 2022 20:52:46 +0200 Subject: [PATCH] fix mail errors --- src/Util.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Util.hs b/src/Util.hs index 310bb68..bf1d029 100644 --- a/src/Util.hs +++ b/src/Util.hs @@ -107,7 +107,8 @@ sendAdminNotification -> T.Text -- The mail body -> MateHandler () sendAdminNotification subject message = do - allUsers <- userGetAll + conn <- asks rsConnection + allUsers <- userDetailsSelectAll conn admins <- mapM (\uid -> checkCapability uid roleCanManageSettings. userDetailsId) allUsers @@ -122,7 +123,8 @@ sendAdminNotification subject message = do ] , mailCc = [] , mailBcc =[] - , mailHeaders = + , mailHeaders = [("Subject", subject)] + , mailParts = [[ Part { partType = "text/plain; charset=utf8" , partEncoding = None @@ -135,7 +137,7 @@ sendAdminNotification subject message = do in sendNotification mail ) - allUsers + admins sendNotification :: Mail -> MateHandler () sendNotification mail = do