module Jobs.Handler.SendTestEmail ( dispatchJobSendTestEmail ) where import Import import Handler.Utils.Mail import Handler.Utils.DateTime dispatchJobSendTestEmail :: Email -> MailContext -> JobHandler UniWorX dispatchJobSendTestEmail jEmail jMailContext = JobHandlerException . mailT jMailContext $ do _mailTo .= [Address Nothing jEmail] replaceMailHeader "Auto-Submitted" $ Just "auto-generated" setSubjectI MsgMailTestSubject now <- liftIO getCurrentTime nDT <- formatTimeMail SelFormatDateTime now nD <- formatTimeMail SelFormatDate now nT <- formatTimeMail SelFormatTime now addHtmlMarkdownAlternatives $ \(MsgRenderer mr) -> [shamlet|

#{mr MsgMailTestContent}

#{mr MsgMailTestDateTime}