-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Send HTML formatted emails using Amazon's SES REST API with blaze
--   
--   Send html emails using Amazon's Simple Email Service and Blaze
--   Templating in Haskell
@package ses-html
@version 0.4.0.0

module Network.SES

-- | Send Emails templated with Blaze using SES
--   
--   <pre>
--   main :: IO ()
--   main = print =&lt;&lt; sendEmailBlaze publicKey secretKey region from to subject html
--    where
--      publicKey = PublicKey "public key goes here"
--      secretKey = SecretKey "secret key goes here"
--      region    = USEast1
--      from    = "verifiedSender@domain.com"
--      to      = ["recipient@domain.com"]
--      subject = "Test Subject"
--      html = H.html $ do
--               H.body $ do
--                  H.h1 "Html email!"
--   </pre>
sendEmailBlaze :: PublicKey -> SecretKey -> Region -> From -> To -> Subject -> Html -> IO SESResult

-- | Send emails without using Blaze, raw bytes are expected to be valid
--   HTML
sendEmail :: PublicKey -> SecretKey -> Region -> From -> To -> Subject -> ByteString -> IO SESResult
type From = ByteString
type To = [ByteString]
type Subject = ByteString

-- | Types for AWS Keys
newtype PublicKey
PublicKey :: ByteString -> PublicKey
newtype SecretKey
SecretKey :: ByteString -> SecretKey

-- | Types for AWS <a>Region</a>s
data Region

-- | US East 1 Region
USEast1 :: Region

-- | US West 2 Region
USWest2 :: Region

-- | EU West 1 Region
EUWest1 :: Region

-- | Common Error Types for SES
--   
--   <a>http://s3.amazonaws.com/awsdocs/ses/latest/ses-api.pdf</a>
data SESErrorType
IncompleteSignature :: SESErrorType
InternalFailure :: SESErrorType
InvalidAction :: SESErrorType
InvalidClientTokenId :: SESErrorType
InvalidParameterCombination :: SESErrorType
InvalidParameterValue :: SESErrorType
InvalidQueryParameter :: SESErrorType
MalformedQueryString :: SESErrorType
MissingAction :: SESErrorType
MissingAuthenticationToken :: SESErrorType
SignatureDoesNotMatch :: SESErrorType
MissingParameter :: SESErrorType
MessageRejected :: SESErrorType
OptInRequired :: SESErrorType
RequestExpired :: SESErrorType
ServiceUnavailable :: SESErrorType
Throttling :: SESErrorType
UnknownErrorType :: SESErrorType
ValidationError :: SESErrorType
data SESError

-- | Connection Error, can occur on open &amp; close or on send &amp;
--   receive of a Request or Response
SESConnectionError :: ByteString -> SESError

-- | If a request is made successfully but the parameters specifed were
--   incorrect
SESError :: SESErrorCode -> SESErrorType -> SESErrorMessage -> SESError

-- | The result of invoking an SES action
data SESResult

-- | The encapsulated <a>SESError</a>
Error :: SESError -> SESResult

-- | A successful email has been sent
Success :: SESResult

-- | Types to hold SES Errors
type SESErrorCode = Int  Error Code returned from SES XML response
type SESErrorMessage = ByteString  Error Message returned from SES Message
instance GHC.Show.Show Network.SES.SESResult
instance GHC.Show.Show Network.SES.SESError
instance GHC.Read.Read Network.SES.SESErrorType
instance GHC.Show.Show Network.SES.SESErrorType
instance GHC.Classes.Eq Network.SES.SecretKey
instance GHC.Show.Show Network.SES.SecretKey
instance GHC.Classes.Eq Network.SES.PublicKey
instance GHC.Show.Show Network.SES.PublicKey
instance GHC.Show.Show Network.SES.Region
