From d985e879e574c770453590791bc35352c2632d01 Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Wed, 12 Aug 2015 10:16:59 +0200 Subject: Translating sign in page and mail --- src/server/View/Mail/SignIn.hs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/server/View/Mail') diff --git a/src/server/View/Mail/SignIn.hs b/src/server/View/Mail/SignIn.hs index e11b876..5eb181b 100644 --- a/src/server/View/Mail/SignIn.hs +++ b/src/server/View/Mail/SignIn.hs @@ -14,12 +14,15 @@ import Text.Blaze.Html.Renderer.Text (renderHtml) import Model.Database (User(..)) import qualified Model.Mail as M +import Model.Message.Key +import Model.Message getMail :: User -> Text -> [Text] -> M.Mail getMail user url to = M.Mail - { M.to = to - , M.subject = "Sign in to Shared Cost" + { M.from = (getMessage NoReplyMail) + , M.to = to + , M.subject = (getMessage SignInMailTitle) , M.plainBody = plainBody user url , M.htmlBody = htmlBody user url } @@ -28,19 +31,19 @@ plainBody :: User -> Text -> LT.Text plainBody user url = LT.intercalate "\n" - [ LT.concat ["Hi ", strictToLazy . userName $ user, ","] + [ strictToLazy (getVarMessage [userName user] HiMail) , "" - , "Click to the following link in order to sign in to Shared Cost:" + , strictToLazy (getMessage SignInLinkMail) , strictToLazy url ] htmlBody :: User -> Text -> LT.Text htmlBody user url = renderHtml . docTypeHtml . body $ do - toHtml $ LT.concat ["Hi ", strictToLazy . userName $ user, ","] + toHtml $ strictToLazy (getVarMessage [userName user] HiMail) br br - "Click to the following link in order to sign in to Shared Cost:" + toHtml $ strictToLazy (getMessage SignInLinkMail) br toHtml url -- cgit v1.2.3