Safe Haskell | None |
---|---|
Language | Haskell2010 |
Network.SES
Contents
- sendEmailBlaze :: PublicKey -> SecretKey -> Region -> From -> To -> Subject -> Html -> IO SESResult
- sendEmail :: PublicKey -> SecretKey -> Region -> From -> To -> Subject -> ByteString -> IO SESResult
- type From = ByteString
- type To = [ByteString]
- type Subject = ByteString
- newtype PublicKey = PublicKey ByteString
- newtype SecretKey = SecretKey ByteString
- data Region
- data SESErrorType
- = IncompleteSignature
- | InternalFailure
- | InvalidAction
- | InvalidClientTokenId
- | InvalidParameterCombination
- | InvalidParameterValue
- | InvalidQueryParameter
- | MalformedQueryString
- | MissingAction
- | MissingAuthenticationToken
- | SignatureDoesNotMatch
- | MissingParameter
- | MessageRejected
- | OptInRequired
- | RequestExpired
- | ServiceUnavailable
- | Throttling
- | UnknownErrorType
- | ValidationError
- data SESError
- data SESResult
- type SESErrorCode = Int
- type SESErrorMessage = ByteString
Email creation
Arguments
:: PublicKey | AWS Public Key |
-> SecretKey | AWS Secret Key |
-> Region | The Region to send the Request |
-> From | The Email sender |
-> To | The Email recipient |
-> Subject | The Subject of the Email |
-> Html | The Html of the email body |
-> IO SESResult |
Send Emails templated with Blaze using SES
main :: IO () main = print =<< sendEmailBlaze publicKey secretKey region from to subject html where publicKey = PublicKey "public key goes here" secretKey = SecretKey "secret key goes here" region = USEast1 from = "[email protected]" to = ["[email protected]"] subject = "Test Subject" html = H.html $ do H.body $ do H.h1 "Html email!"
Arguments
:: PublicKey | AWS Public Key |
-> SecretKey | AWS Secret Key |
-> Region | The Region to send the Request |
-> From | The Email sender |
-> To | The Email recipient |
-> Subject | The Subject of the Email |
-> ByteString | Raw Html |
-> IO SESResult |
Send emails without using Blaze, raw bytes are expected to be valid HTML
Types
type From = ByteString Source
type To = [ByteString] Source
type Subject = ByteString Source
Types for AWS Keys
Constructors
PublicKey ByteString |
Types for AWS Region
s
data SESErrorType Source
Common Error Types for SES
http://s3.amazonaws.com/awsdocs/ses/latest/ses-api.pdf
Constructors
Instances
Constructors
SESConnectionError ByteString | Connection Error, can occur on open & close or on send & receive of a Request or Response |
SESError SESErrorCode SESErrorType SESErrorMessage | If a request is made successfully but the parameters specifed were incorrect |
The result of invoking an SES action
type SESErrorCode Source
Arguments
= Int | Error Code returned from SES XML response |
Types to hold SES Errors
type SESErrorMessage Source
Arguments
= ByteString | Error Message returned from SES Message |