git.iko.soy/typeable/mandrill
on master help sign in
Changed the MandrillHeaders type synonym from Value to Object
8526ea6Bas van Dijk
README.md+4
@@ -8,6 +8,10 @@ the [Mandrill](http://mandrillapp.com) transactional email service.
8
8
9# Changelog
9# Changelog
10
10
11+## Version 0.5.0.0
12+
13+* Changed the MandrillHeaders type synonym from Value to Object.
14+
11## Version 0.4.0.0
15## Version 0.4.0.0
12
16
13* Modified the `Base64ByteString` type to accept another constructor. This
17* Modified the `Base64ByteString` type to accept another constructor. This
mandrill.cabal+2−1
@@ -1,5 +1,5 @@
1name: mandrill
1name: mandrill
2−version: 0.4.1.0
2+version: 0.5.0.0
3synopsis: Library for interfacing with the Mandrill JSON API
3synopsis: Library for interfacing with the Mandrill JSON API
4description: Pure Haskell client for the Mandrill JSON API
4description: Pure Haskell client for the Mandrill JSON API
5license: MIT
5license: MIT
@@ -46,6 +46,7 @@ library
46 , time
46 , time
47 , email-validate >= 1.0.0
47 , email-validate >= 1.0.0
48 , old-locale
48 , old-locale
49+ , unordered-containers
49 hs-source-dirs:
50 hs-source-dirs:
50 src
51 src
51 default-language:
52 default-language:
src/Network/API/Mandrill.hs+3−2
@@ -32,6 +32,7 @@ import Data.Monoid
32import Text.Email.Validate
32import Text.Email.Validate
33import qualified Data.Text as T
33import qualified Data.Text as T
34import qualified Data.Aeson as JSON
34import qualified Data.Aeson as JSON
35+import qualified Data.HashMap.Strict as H
35
36
36{- $exampleusage
37{- $exampleusage
37
38
@@ -40,7 +41,7 @@ The API was designed to allow to get you started as quickly as possible:
40> {-# LANGUAGE OverloadedStrings #-}
41> {-# LANGUAGE OverloadedStrings #-}
41> import Text.Email.Validate
42> import Text.Email.Validate
42> import Network.API.Mandrill
43> import Network.API.Mandrill
43−>
44+>
44> main :: IO ()
45> main :: IO ()
45> main = do
46> main = do
46> case validate "foo@example.com" of
47> case validate "foo@example.com" of
@@ -66,7 +67,7 @@ emptyMessage f t = MandrillMessage {
66 , _mmsg_from_email = (MandrillEmail f)
67 , _mmsg_from_email = (MandrillEmail f)
67 , _mmsg_from_name = Nothing
68 , _mmsg_from_name = Nothing
68 , _mmsg_to = map newRecipient t
69 , _mmsg_to = map newRecipient t
69− , _mmsg_headers = JSON.Null
70+ , _mmsg_headers = H.empty
70 , _mmsg_important = Nothing
71 , _mmsg_important = Nothing
71 , _mmsg_track_opens = Nothing
72 , _mmsg_track_opens = Nothing
72 , _mmsg_track_clicks = Nothing
73 , _mmsg_track_clicks = Nothing
src/Network/API/Mandrill/Types.hs+4−3
@@ -19,6 +19,7 @@ import System.Locale (TimeLocale, defaultTimeLocale)
19#endif
19#endif
20import qualified Data.ByteString as B
20import qualified Data.ByteString as B
21import qualified Data.ByteString.Base64 as Base64
21import qualified Data.ByteString.Base64 as Base64
22+import qualified Data.HashMap.Strict as H
22import qualified Data.Text as T
23import qualified Data.Text as T
23import qualified Data.Text.Encoding as TL
24import qualified Data.Text.Encoding as TL
24import qualified Data.Text.Lazy as TL
25import qualified Data.Text.Lazy as TL
@@ -170,7 +171,7 @@ type MandrillTags = T.Text
170
171
171
172
172--------------------------------------------------------------------------------
173--------------------------------------------------------------------------------
173−type MandrillHeaders = Value
174+type MandrillHeaders = Object
174
175
175
176
176--------------------------------------------------------------------------------
177--------------------------------------------------------------------------------
@@ -266,7 +267,7 @@ data MandrillMessage = MandrillMessage {
266 , _mmsg_tracking_domain :: Maybe T.Text
267 , _mmsg_tracking_domain :: Maybe T.Text
267 -- ^ a custom domain to use for tracking opens and clicks instead of mandrillapp.com
268 -- ^ a custom domain to use for tracking opens and clicks instead of mandrillapp.com
268 , _mmsg_signing_domain :: Maybe Bool
269 , _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
270 -- (for "via" or "on behalf of" in email clients)
271 -- (for "via" or "on behalf of" in email clients)
271 , _mmsg_return_path_domain :: Maybe Bool
272 , _mmsg_return_path_domain :: Maybe Bool
272 -- ^ a custom domain to use for the messages's return-path
273 -- ^ a custom domain to use for the messages's return-path
@@ -319,7 +320,7 @@ instance Arbitrary MandrillMessage where
319 <*> pure (MandrillEmail . fromJust $ emailAddress "sender@example.com")
320 <*> pure (MandrillEmail . fromJust $ emailAddress "sender@example.com")
320 <*> pure Nothing
321 <*> pure Nothing
321 <*> resize 2 arbitrary
322 <*> resize 2 arbitrary
322− <*> pure emptyObject
323+ <*> pure H.empty
323 <*> pure Nothing
324 <*> pure Nothing
324 <*> pure Nothing
325 <*> pure Nothing
325 <*> pure Nothing
326 <*> pure Nothing