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.
13* Added `Functor`, `Foldable` and `Traversable` instances to `MandrillResponse` (Courtesy of @dredozubov)
17* Added inbound calls (Courtesy of @mwotton)
21* Relaxed the constraint on `aeson` to allow `0.11.0.0`.
25* Changed the `MandrillHeaders` type synonym from `Value` to `Object`.
27* Changed the `mmsg_metadata` and `mmdt_values` fields from `MandrillVars` to `Object`.
29* Changed the `mmsg_global_merge_vars` and `mmvr_vars` fields from `[MandrillVars]` to `[MergeVar]`
31* Added the `MergeVar` data type:
34data MergeVar = MergeVar {
36 , _mv_content :: Value
40* Removed the `MandrillVars` type synonym.
44* Modified the `Base64ByteString` type to accept another constructor. This
45 allows the user to pass already-encoded Base64 strings which might be coming
50This package was built with pragmatism and reuse in mind. This means
51this API comes in two flavours: an IO-based and an handy monad transformer
52which can be plugged in your stack of choice.
56{-# LANGUAGE OverloadedStrings #-}
57import Text.Email.Validate
58import Network.API.Mandrill
62 case validate "foo@example.com" of
63 Left err -> print $ "Invalid email!" ++ show err
64 Right addr -> runMandrill "MYTOKENHERE" $ do
65 let msg = "<p>My Html</p>"
66 res <- sendEmail (newTextMessage addr [addr] "Hello" msg)
68 MandrillSuccess k -> liftIO (print k)
69 MandrillFailure f -> liftIO (print f)
72# Supported API versions
75 - [Users call](https://mandrillapp.com/api/docs/users.JSON.html) - 100%
77 + ~~ping.json~~ (as **doesn't return valid json!**)
80 - [Messages call](https://mandrillapp.com/api/docs/messages.JSON.html)
85To test the online API, first build the package with tests enabled:
88cabal install --enable-tests
91Then export an environment variable with your Mandrill **Test** token:
94export MANDRILL_API_KEY="YOURKEYGOESHERE"
97And finally execute the testsuite:
104This library scratches my own itches, but please fork away!
105Pull requests are encouraged to implement the part of the API
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