ses-html

Send HTML formatted emails using Amazon's SES REST API with blaze

LTS Haskell 14.1:0.4.0.0
Stackage Nightly 2019-08-18:0.4.0.0
Latest on Hackage:0.4.0.0

See all snapshots ses-html appears in

BSD-3-Clause licensed by David Johnson
Maintained by djohnson.m@gmail.com

Module documentation for 0.4.0.0

This version can be pinned in stack with:ses-html-0.4.0.0@sha256:0f8fea6229951e565b6e37041175b0f578e5458e2c3395e7cdc84c187a69275d,1150

ses-html

Hackage Hackage Dependencies Haskell Programming Language BSD3 License Build Status

Send blaze-html emails via the AWS SES API using http-streams http://hackage.haskell.org/package/ses-html

Example

{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE LambdaCase #-}

module Main where

import Network.SES ( sendEmailBlaze
                   , PublicKey(..)
                   , SecretKey(..)
                   , SESResult(..)
                   , SESError
                   , Region(USEast1)
                   )

import qualified Text.Blaze.Html5 as H
import qualified Text.Blaze.Html5.Attributes as A

main :: IO ()
main = sendMail >>= \case
         Error _ -> putStrLn "There was an error :("
         Success -> putStrLn "Email sent successfully!"

sendMail :: IO SESREsult
sendMail = sendEmailBlaze publicKey secretKey region from to subject html
 where
   publicKey = PublicKey "public key goes here"
   secretKey = SecretKey "secret key goes here"
   region    = USEast1
   from    = "support@solidtranslate.com"
   to      = ["david@solidtranslate.com"]
   subject = "Test Subject"
   html = H.html $ do
            H.body $ do
               H.img H.! A.src "http://haskell-lang.org/static/img/logo.png"
               H.h1 "Html email! Hooray"

Result

comments powered byDisqus