1[](https://travis-ci.org/adinapoli/mandrill)
2[](https://coveralls.io/r/adinapoli/mandrill)
4# Haskell Client for the Mandrill JSON API
6This module implement a low-level, 1:1 mapping API to
7the [Mandrill](http://mandrillapp.com) transactional email service.
11This package was built with pragmatism and reuse in mind. This means
12this API comes in two flavours: an IO-based and an handy monad transformers
13which can be plugged in your stack of choice.
17{-# LANGUAGE OverloadedStrings #-}
18import Text.Email.Validate
19import Network.API.Mandrill
23 case validate "foo@example.com" of
24 Left err -> print $ "Invalid email!" ++ show err
25 Right addr -> runMandrill "MYTOKENHERE" $ do
26 let msg = "<p>My Html</p>"
27 res <- sendEmail (newTextMessage addr addr "Hello" msg)
29 MandrillSuccess k -> liftIO (print k)
30 MandrillFailure f -> liftIO (print f)
33# Supported API versions
36 - [Users call](https://mandrillapp.com/api/docs/users.JSON.html) - 100%
38 + ~~ping.json~~ (as **doesn't return valid json!**)
41 - [Messages call](https://mandrillapp.com/api/docs/messages.JSON.html)
46To test the online API, first build the package with tests enabled:
49cabal install --enable-tests
52Then export an environment variable with your Mandrill **Test** token:
55export MANDRILL_API_KEY="YOURKEYGOESHERE"
58And finally execute the testsuite:
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list