29 lines
726 B
Haskell
29 lines
726 B
Haskell
module Jobs.Handler.SendTestEmail
|
|
( dispatchJobSendTestEmail
|
|
) where
|
|
|
|
import Import hiding ((.=))
|
|
|
|
import Handler.Utils.DateTime
|
|
|
|
import Text.Shakespeare.Text
|
|
|
|
import Utils.Lens
|
|
|
|
dispatchJobSendTestEmail :: Email -> MailContext -> Handler ()
|
|
dispatchJobSendTestEmail jEmail jMailContext = mailT jMailContext $ do
|
|
_mailTo .= [Address Nothing jEmail]
|
|
setSubjectI MsgMailTestSubject
|
|
now <- liftIO getCurrentTime
|
|
nDT <- formatTimeMail SelFormatDateTime now
|
|
nD <- formatTimeMail SelFormatDate now
|
|
nT <- formatTimeMail SelFormatTime now
|
|
addPart $ \(MsgRenderer mr) -> ([text|
|
|
#{mr MsgMailTestContent}
|
|
|
|
#{mr MsgMailTestDateTime}
|
|
* #{nDT}
|
|
* #{nD}
|
|
* #{nT}
|
|
|] :: TextUrl (Route UniWorX))
|