aboutsummaryrefslogtreecommitdiff
path: root/src/server/View/Mail
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/View/Mail')
-rw-r--r--src/server/View/Mail/SignIn.hs15
1 files changed, 9 insertions, 6 deletions
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