This module implement a low-level, 1:1 mapping API to the Mandrill transactional email service.
newTemplateMessage'
for sending message that uses a template whose sender address and subject are already configured in the Mandrill server.mmsg_subject
and mmsg_from_email
optional.Functor
, Foldable
and Traversable
instances to MandrillResponse
(Courtesy of @dredozubov)aeson
to allow 0.11.0.0
.Changed the MandrillHeaders
type synonym from Value
to Object
.
Changed the mmsg_metadata
and mmdt_values
fields from MandrillVars
to Object
.
Changed the mmsg_global_merge_vars
and mmvr_vars
fields from [MandrillVars]
to [MergeVar]
Added the MergeVar
data type:
data MergeVar = MergeVar {
_mv_name :: !Text
, _mv_content :: Value
}
MandrillVars
type synonym.Base64ByteString
type to accept another constructor. This
allows the user to pass already-encoded Base64 strings which might be coming
upstream.This package was built with pragmatism and reuse in mind. This means this API comes in two flavours: an IO-based and an handy monad transformer which can be plugged in your stack of choice. Example:
{-# LANGUAGE OverloadedStrings #-}
import Text.Email.Validate
import Network.API.Mandrill
main :: IO ()
main = do
case validate "foo@example.com" of
Left err -> print $ "Invalid email!" ++ show err
Right addr -> runMandrill "MYTOKENHERE" $ do
let msg = "<p>My Html</p>"
res <- sendEmail (newTextMessage addr [addr] "Hello" msg)
case res of
MandrillSuccess k -> liftIO (print k)
MandrillFailure f -> liftIO (print f)
1.0 (partially)
Users call - 100%
info.json
ping.json (as doesn't return valid json!)
ping2.json
senders.json
send.json
verify-domain.json
add-route.json
add-domain.json
To test the online API, first build the package with tests enabled:
cabal install --enable-tests
Then export an environment variable with your Mandrill Test token:
export MANDRILL_API_KEY="YOURKEYGOESHERE"
And finally execute the testsuite:
cabal test
This library scratches my own itches, but please fork away! Pull requests are encouraged to implement the part of the API you need.