From 4d375e76801ba6a52e0d20b0e2490ac81e8ea8dc Mon Sep 17 00:00:00 2001 From: Steffen Jost Date: Thu, 15 Sep 2022 15:42:27 +0200 Subject: [PATCH] chore(lms): fix convenience link formatting in lms mails and pdf --- src/Jobs/Handler/SendNotification/Qualification.hs | 4 +++- templates/letter/fraport_renewal.md | 7 ++++--- templates/mail/userAuthModeUpdate.hamlet | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Jobs/Handler/SendNotification/Qualification.hs b/src/Jobs/Handler/SendNotification/Qualification.hs index 3b1b5a30b..5a963e4c8 100644 --- a/src/Jobs/Handler/SendNotification/Qualification.hs +++ b/src/Jobs/Handler/SendNotification/Qualification.hs @@ -66,6 +66,7 @@ dispatchNotificationQualificationRenewal nQualification jRecipient = do expiryDate <- formatTimeUser SelFormatDate qualificationUserValidUntil $ Just entRecipient let printJobName = "RenewalPin" + lmsUrl = "https://drive.fraport.de" prepAddress upa = userDisplayName : (upa & html2textlines) -- TODO: use supervisor's address lmsIdent = lmsUserIdent & getLmsIdent pdfMeta = mkMeta @@ -77,7 +78,8 @@ dispatchNotificationQualificationRenewal nQualification jRecipient = do , mbMeta "address" (prepAddress <$> userPostAddress) , toMeta "expiry" expiryDate , mbMeta "validduration" (show <$> qualificationValidDuration) - , toMeta "url" ("[https://drive.fraport.de](https://drive.fraport.de/?login=" <> lmsIdent <> ")") + , toMeta "url-text" lmsUrl + , toMeta "url" (lmsUrl <> "/?login=" <> lmsIdent) ] pdfRenewal pdfMeta >>= \case Left err -> do diff --git a/templates/letter/fraport_renewal.md b/templates/letter/fraport_renewal.md index 9c86edb03..a23833298 100644 --- a/templates/letter/fraport_renewal.md +++ b/templates/letter/fraport_renewal.md @@ -21,7 +21,8 @@ encludes: hyperrefoptions: hidelinks ### Metadaten, welche automatisch ersetzt werden: -url: +url-text: 'https://drive.fraport.de' +url: 'https://drive.fraport.de' date: 11.11.1111 expiry: 00.00.0000 lang: de-de @@ -66,7 +67,7 @@ Prüfling URL - : $url$ + : [$url-text$]($url$) Sobald die Frist abgelaufen ist, muss zur Wiedererlangung des Vorfeldführerscheins @@ -93,7 +94,7 @@ Examinee URL - : $url$ + :[$url-text$]($url$) Should your apron driving licence expire before completing this diff --git a/templates/mail/userAuthModeUpdate.hamlet b/templates/mail/userAuthModeUpdate.hamlet index 79cf44dc6..3ac3aeaf5 100644 --- a/templates/mail/userAuthModeUpdate.hamlet +++ b/templates/mail/userAuthModeUpdate.hamlet @@ -27,7 +27,7 @@ $newline never $if is _AuthPWHash userAuthentication

_{SomeMessage MsgAuthPWHashTip} -

+
_{SomeMessage MsgPWHashIdent}