Invitation e-mails
This commit is contained in:
parent
8591306b14
commit
7f6d30c0d6
@ -3,6 +3,11 @@ module Jobs.Handler.Invitation
|
|||||||
) where
|
) where
|
||||||
|
|
||||||
import Import
|
import Import
|
||||||
|
import Utils.Lens
|
||||||
|
import Handler.Utils.Mail
|
||||||
|
|
||||||
|
import qualified Data.CaseInsensitive as CI
|
||||||
|
import Text.Hamlet
|
||||||
|
|
||||||
|
|
||||||
dispatchJobInvitation :: UserId
|
dispatchJobInvitation :: UserId
|
||||||
@ -11,4 +16,12 @@ dispatchJobInvitation :: UserId
|
|||||||
-> Text
|
-> Text
|
||||||
-> Html
|
-> Html
|
||||||
-> Handler ()
|
-> Handler ()
|
||||||
dispatchJobInvitation = error "dispatchJobInvitation"
|
dispatchJobInvitation jInviter jInvitee jInvitationUrl jInvitationSubject jInvitationExplanation = do
|
||||||
|
mInviter <- runDB $ get jInviter
|
||||||
|
|
||||||
|
whenIsJust mInviter $ \jInviter' -> mailT def $ do
|
||||||
|
_mailTo .= [Address Nothing $ CI.original jInvitee]
|
||||||
|
replaceMailHeader "Reply-To" . Just . renderAddress $ userAddress jInviter'
|
||||||
|
replaceMailHeader "Auto-Submitted" $ Just "auto-generated"
|
||||||
|
replaceMailHeader "Subject" $ Just jInvitationSubject
|
||||||
|
addPart ($(ihamletFile "templates/mail/invitation.hamlet") :: HtmlUrlI18n UniWorXMessage (Route UniWorX))
|
||||||
|
|||||||
11
templates/mail/invitation.hamlet
Normal file
11
templates/mail/invitation.hamlet
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
$newline never
|
||||||
|
\<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<body>
|
||||||
|
<p>
|
||||||
|
#{jInvitationExplanation}
|
||||||
|
<p>
|
||||||
|
<a href=#{jInvitationUrl}>
|
||||||
|
_{MsgInvitationAcceptDecline}
|
||||||
Reference in New Issue
Block a user