BuildBox.Command.Mail
Description
Sending email. We've got baked in support for msmtp
, which is easy to set up. Adding support for other mailers
should be easy. Get msmtp
here: http://msmtp.sourceforge.net
- data Mail = Mail {
- mailFrom :: String
- mailTo :: String
- mailSubject :: String
- mailTime :: UTCTime
- mailTimeZone :: TimeZone
- mailMessageId :: String
- mailBody :: String
- data Mailer = MailerMSMTP {
- mailerPath :: FilePath
- mailerPort :: Maybe Int
- createMailWithCurrentTime :: String -> String -> String -> String -> Build Mail
- renderMail :: Mail -> Doc
- sendMailWithMailer :: Mail -> Mailer -> Build ()
Documentation
An email message that we can send.
Constructors
Fields
|
An external mailer that can send messages. Also contains mail server info if needed. We only support msmtp at the moment.
Constructors
MailerMSMTP | |
Fields
|
createMailWithCurrentTimeSource
Arguments
:: String | ''from'' field. Should be an email address. |
-> String | ''to'' field. Should be an email address. |
-> String | Subject line. |
-> String | Message body. |
-> Build Mail |
Create a mail with a given from, to, subject and body. Fill in the date and message id based on the current time. Valid dates and message ids are needed to prevent the mail being bounced by spambots.
renderMail :: Mail -> DocSource
Render an email message as a string.