Skip to content

Commit aee5487

Browse files
committed
added sending email
1 parent 87e16c8 commit aee5487

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

services/brig/src/Brig/User/Email.hs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,15 @@ sendVerificationMail to pair loc = do
5656

5757
sendLoginVerificationMail :: Email -> Code.Value -> Maybe Locale -> (AppIO r) ()
5858
sendLoginVerificationMail email code mbLocale = do
59-
tpl <- verificationLoginEmail . snd <$> userTemplates mbLocale
59+
tpl <- verificationScimTokenEmail . snd <$> userTemplates mbLocale
6060
branding <- view templateBranding
6161
Email.sendMail $ renderSecondFactorVerificationEmail tpl email code branding
6262

6363
sendGenerateScimTokenVerificationMail :: Email -> Code.Value -> Maybe Locale -> (AppIO r) ()
64-
sendGenerateScimTokenVerificationMail _ _ _ = pure () --todo(leif): implement
64+
sendGenerateScimTokenVerificationMail email code mbLocale = do
65+
tpl <- verificationLoginEmail . snd <$> userTemplates mbLocale
66+
branding <- view templateBranding
67+
Email.sendMail $ renderSecondFactorVerificationEmail tpl email code branding
6568

6669
sendActivationMail :: Email -> Name -> ActivationPair -> Maybe Locale -> Maybe UserIdentity -> (AppIO r) ()
6770
sendActivationMail to name pair loc ident = do

services/brig/src/Brig/User/Template.hs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ data UserTemplates = UserTemplates
5858
deletionSms :: !DeletionSmsTemplate,
5959
deletionEmail :: !DeletionEmailTemplate,
6060
newClientEmail :: !NewClientEmailTemplate,
61-
verificationLoginEmail :: !SecondFactorVerificationEmailTemplate
61+
verificationLoginEmail :: !SecondFactorVerificationEmailTemplate,
62+
verificationScimTokenEmail :: !SecondFactorVerificationEmailTemplate
6263
}
6364

6465
data ActivationSmsTemplate = ActivationSmsTemplate
@@ -234,6 +235,13 @@ loadUserTemplates o = readLocalesDir defLocale templateDir "user" $ \fp ->
234235
<*> pure emailSender
235236
<*> readText fp "email/sender.txt"
236237
)
238+
<*> ( SecondFactorVerificationEmailTemplate
239+
<$> readTemplate fp "email/verification-scim-token-subject.txt"
240+
<*> readTemplate fp "email/verification-scim-token.txt"
241+
<*> readTemplate fp "email/verification-scim-token.html"
242+
<*> pure emailSender
243+
<*> readText fp "email/sender.txt"
244+
)
237245
where
238246
gOptions = Opt.general $ Opt.emailSMS o
239247
uOptions = Opt.user $ Opt.emailSMS o

0 commit comments

Comments
 (0)