git.iko.soy/typeable/mandrill
on master help sign in
Changed the MandrillHeaders type synonym from Value to Object
commit8526ea6de6699c0712f359db4fdc9e9e865d6b59 authorBas van Dijk <v.dijk.bas@gmail.com> dateFri 2 Oct 2015, 11:21 (11 years ago) parentceec6d1
4 files changed+13−6
README.md+4 mandrill.cabal+2−1 src/Network/API/Mandrill.hs+3−2 src/Network/API/Mandrill/Types.hs+4−3
README.md+4
@@ -8,6 +8,10 @@ the [Mandrill](http://mandrillapp.com) transactional email service.
88
99# Changelog
1010
11+## Version 0.5.0.0
12+
13+* Changed the MandrillHeaders type synonym from Value to Object.
14+
1115## Version 0.4.0.0
1216
1317* Modified the `Base64ByteString` type to accept another constructor. This
mandrill.cabal+2−1
@@ -1,5 +1,5 @@
11name: mandrill
2−version: 0.4.1.0
2+version: 0.5.0.0
33synopsis: Library for interfacing with the Mandrill JSON API
44description: Pure Haskell client for the Mandrill JSON API
55license: MIT
@@ -46,6 +46,7 @@ library
4646 , time
4747 , email-validate >= 1.0.0
4848 , old-locale
49+ , unordered-containers
4950 hs-source-dirs:
5051 src
5152 default-language:
src/Network/API/Mandrill.hs+3−2
@@ -32,6 +32,7 @@ import Data.Monoid
3232import Text.Email.Validate
3333import qualified Data.Text as T
3434import qualified Data.Aeson as JSON
35+import qualified Data.HashMap.Strict as H
3536
3637{- $exampleusage
3738
@@ -40,7 +41,7 @@ The API was designed to allow to get you started as quickly as possible:
4041> {-# LANGUAGE OverloadedStrings #-}
4142> import Text.Email.Validate
4243> import Network.API.Mandrill
43−>
44+>
4445> main :: IO ()
4546> main = do
4647> case validate "foo@example.com" of
@@ -66,7 +67,7 @@ emptyMessage f t = MandrillMessage {
6667 , _mmsg_from_email = (MandrillEmail f)
6768 , _mmsg_from_name = Nothing
6869 , _mmsg_to = map newRecipient t
69− , _mmsg_headers = JSON.Null
70+ , _mmsg_headers = H.empty
7071 , _mmsg_important = Nothing
7172 , _mmsg_track_opens = Nothing
7273 , _mmsg_track_clicks = Nothing
src/Network/API/Mandrill/Types.hs+4−3
@@ -19,6 +19,7 @@ import System.Locale (TimeLocale, defaultTimeLocale)
1919#endif
2020import qualified Data.ByteString as B
2121import qualified Data.ByteString.Base64 as Base64
22+import qualified Data.HashMap.Strict as H
2223import qualified Data.Text as T
2324import qualified Data.Text.Encoding as TL
2425import qualified Data.Text.Lazy as TL
@@ -170,7 +171,7 @@ type MandrillTags = T.Text
170171
171172
172173--------------------------------------------------------------------------------
173−type MandrillHeaders = Value
174+type MandrillHeaders = Object
174175
175176
176177--------------------------------------------------------------------------------
@@ -266,7 +267,7 @@ data MandrillMessage = MandrillMessage {
266267 , _mmsg_tracking_domain :: Maybe T.Text
267268 -- ^ a custom domain to use for tracking opens and clicks instead of mandrillapp.com
268269 , _mmsg_signing_domain :: Maybe Bool
269− -- ^ a custom domain to use for SPF/DKIM signing instead of mandrill
270+ -- ^ a custom domain to use for SPF/DKIM signing instead of mandrill
270271 -- (for "via" or "on behalf of" in email clients)
271272 , _mmsg_return_path_domain :: Maybe Bool
272273 -- ^ a custom domain to use for the messages's return-path
@@ -319,7 +320,7 @@ instance Arbitrary MandrillMessage where
319320 <*> pure (MandrillEmail . fromJust $ emailAddress "sender@example.com")
320321 <*> pure Nothing
321322 <*> resize 2 arbitrary
322− <*> pure emptyObject
323+ <*> pure H.empty
323324 <*> pure Nothing
324325 <*> pure Nothing
325326 <*> pure Nothing