Copyright | (c) digitally induced GmbH 2020 |
---|---|
Safe Haskell | None |
IHP.Mail
Description
Synopsis
- data MailServer
- class BuildMail mail where
- subject :: (?mail :: mail) => Text
- to :: mail -> Address
- from :: (?mail :: mail) => Address
- html :: (?context :: context, ConfigProvider context) => mail -> Html
- text :: (?context :: context, ConfigProvider context) => mail -> Text
- sendMail :: (BuildMail mail, ?context :: context, ConfigProvider context) => mail -> IO ()
- sendWithMailServer :: MailServer -> Mail -> IO ()
Documentation
data MailServer Source #
Configuration for a mailer used by IHP
Constructors
SES | Uses AWS SES for sending emails |
Fields
| |
Sendmail | Uses the local Sendmail binary for sending emails. Avoid this with IHP Cloud |
SendGrid | Uses SendGrid for sending emails |
SMTP | Uses a generic SMTP for sending emails |
class BuildMail mail where Source #
Methods
subject :: (?mail :: mail) => Text Source #
You can use ?mail
to make this dynamic based on the given entity
to :: mail -> Address Source #
The email receiver
Example: > to ConfirmationMail { .. } = Address { addressName = Just (get email user }
from :: (?mail :: mail) => Address Source #
Your sender address
html :: (?context :: context, ConfigProvider context) => mail -> Html Source #
Similiar to a normal html view, HSX can be used here
text :: (?context :: context, ConfigProvider context) => mail -> Text Source #
When no plain text version of the email is specified it falls back to using the html version but striping out all the html tags
sendMail :: (BuildMail mail, ?context :: context, ConfigProvider context) => mail -> IO () Source #
Sends an email
Uses the mail server provided in the controller context, configured in Config/Config.hs
sendWithMailServer :: MailServer -> Mail -> IO () Source #