The ses-html package

[Tags:bsd3, library]

Send html emails using Amazon's Simple Email Service and Blaze Templating in Haskell


[Skip to Readme]

Properties

Versions 0.1.0.0, 0.2.0.0, 0.2.0.1, 0.2.0.2, 0.2.1.2, 0.3.0.0, 0.3.0.1
Dependencies base (>4 && <5), base64-bytestring, blaze-html, byteable, bytestring, cryptohash, HsOpenSSL, http-streams, tagsoup, time (==1.5.*) [details]
License BSD3
Copyright David Johnson
Author David Johnson
Maintainer djohnson.m@gmail.com
Category Web, AWS, Email, Network
Source repository head: git clone https://github.com/dmjio/ses-html
Uploaded Fri Sep 25 02:46:03 UTC 2015 by DavidJohnson
Distributions NixOS:0.3.0.1
Downloads 1057 total (15 in the last 30 days)
Votes
0 []
Status Docs available [build log]
Last success reported on 2015-09-25 [all 1 reports]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Readme for ses-html

Readme for ses-html-0.3.0.1

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

<img src="http://i.imgur.com/AREDbNk.png"></img>