ses-html: Send HTML formatted emails using Amazon's SES REST API with blaze

[ aws, bsd3, email, library, network, web ] [ Propose Tags ]

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


[Skip to Readme]

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 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, 0.4.0.0
Dependencies base (>4 && <5), base64-bytestring, blaze-html, byteable, bytestring, cryptohash, HsOpenSSL, http-streams, tagsoup, time (>=1.6.0.1) [details]
License BSD-3-Clause
Copyright David Johnson
Author David Johnson
Maintainer djohnson.m@gmail.com
Category Web, AWS, Email, Network
Source repo head: git clone https://github.com/dmjio/ses-html
Uploaded by DavidJohnson at 2017-10-07T20:32:22Z
Distributions LTSHaskell:0.4.0.0, NixOS:0.4.0.0, Stackage:0.4.0.0
Reverse Dependencies 3 direct, 0 indirect [details]
Downloads 6139 total (27 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2017-10-07 [all 1 reports]

Readme for ses-html-0.4.0.0

[back to package description]

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