From 71950d9e5c205f767678e7601584648faa95e734 Mon Sep 17 00:00:00 2001 From: Steffen Jost Date: Mon, 10 Jan 2022 17:29:27 +0100 Subject: [PATCH] refactor(mail): code cleaning and improved messages --- src/Foundation/Yesod/Auth.hs | 2 +- src/Mail.hs | 4 ++-- .../i18n/help-instructions/de-de-formal.hamlet | 14 +++++++------- templates/i18n/help-instructions/en-eu.hamlet | 5 ++--- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/Foundation/Yesod/Auth.hs b/src/Foundation/Yesod/Auth.hs index 95f3ce0fe..a1bd943ac 100644 --- a/src/Foundation/Yesod/Auth.hs +++ b/src/Foundation/Yesod/Auth.hs @@ -269,7 +269,7 @@ upsertCampusUser upsertMode ldapData = do , .. } userUpdate = [ - -- UserDisplayName =. userDisplayName -- SJ asks: why is the display name not updated? + -- UserDisplayName =. userDisplayName -- never updated, since users are allowed to change their DisplayName UserFirstName =. userFirstName , UserSurname =. userSurname , UserEmail =. userEmail diff --git a/src/Mail.hs b/src/Mail.hs index f1642974c..3daa89301 100644 --- a/src/Mail.hs +++ b/src/Mail.hs @@ -315,8 +315,8 @@ defMailT ls (MailT mailC) = do fromAddress <- defaultFromAddress (ret, mail, smtpData) <- runRWST mailC ls (emptyMail fromAddress) mail' <- maybeT (return mail) $ do - guardM $ lift useReplyToInstead -- if sender must be fixed within ObjectIdDomain, use replyTo instead - domain <- lift mailObjectIdDomain + guardM useReplyToInstead -- if sender must be fixed within ObjectIdDomain, use replyTo instead + domain <- mailObjectIdDomain let sender = mail ^. _mailFrom isdomainaddress = (Text.isInfixOf `on` Text.toCaseFold) domain (sender ^. _addressEmail) -- not sure how to use CI.mk and isInfixOf here $logDebugS "Mail" $ "Use ReplyTo instead of Sender: " <> tshow isdomainaddress <> " From was: " <> renderAddress sender <> " From is: " <> renderAddress fromAddress diff --git a/templates/i18n/help-instructions/de-de-formal.hamlet b/templates/i18n/help-instructions/de-de-formal.hamlet index 99370c184..1dd5b5737 100644 --- a/templates/i18n/help-instructions/de-de-formal.hamlet +++ b/templates/i18n/help-instructions/de-de-formal.hamlet @@ -3,13 +3,13 @@ $newline never

Bitte bedenken Sie beim Stellen Ihrer Anfrage, dass das # - Uni2work-Kernteam aktuell aus Sarah Vaupel und Gregor Kleen besteht # - und zwei Personen nicht hinreichend sind um in allen Fällen eine # - zeitnahe Bearbeitung Ihres Anliegens zu garantieren. + FRADrive-Kernteam aktuell zu klein ist, # + um eine zeitnahe Bearbeitung Ihres Anliegens # + zu garantieren.

- Falls sich Ihr Anliegen auf eine konkrete Veranstaltung bezieht, # - ziehen Sie bitte auch in Betracht (insbesondere bei zeitkritischen # - Anliegen wie z.B. Abgaben) sich direkt an die Kursverwalter zu # - wenden. + Falls sich Ihr Anliegen auf einen konkreten Kurs bezieht, # + ziehen Sie bitte auch in Betracht sich direkt an die # + Kursverwalter zu wenden (insbesondere bei zeitkritischen # + Anliegen wie z.B. Abgaben). diff --git a/templates/i18n/help-instructions/en-eu.hamlet b/templates/i18n/help-instructions/en-eu.hamlet index 65e205bae..49a4e8705 100644 --- a/templates/i18n/help-instructions/en-eu.hamlet +++ b/templates/i18n/help-instructions/en-eu.hamlet @@ -2,9 +2,8 @@ $newline never

- When formulating your request please consider that the Uni2work core # - team currently consists of Sarah Vaupel and Gregor Kleen and that # - two people are not enough to guarantee a timely answer in all cases. + When formulating your request please consider that the FRADrive core team # + is currently too small to guarantee a timely answer in all cases.