git.iko.soy/typeable/mandrill
on 54e3320 help sign in
.gitignore−1
since splitsnapshots
unifiedsplit
@@ -3,4 +3,3 @@ dist
3cabal.sandbox.config
3cabal.sandbox.config
4shell.nix
4shell.nix
5.stack-work
5.stack-work
6−tags
README.md−4
@@ -8,10 +8,6 @@ the [Mandrill](http://mandrillapp.com) transactional email service.
8
8
9# Changelog
9# Changelog
10
10
11−## Version 0.5.3.5
12−
13−* Replaced dependency on lens with microlens (Courtesy of @tom-bop)
14−
15## Version 0.5.3.3
11## Version 0.5.3.3
16
12
17* Relaxed upper bound on Aeson (see: fpco/stackage/issues/3337)
13* Relaxed upper bound on Aeson (see: fpco/stackage/issues/3337)
mandrill.cabal+2−1
@@ -41,7 +41,8 @@ library
41 , http-types >= 0.8.0
41 , http-types >= 0.8.0
42 , http-client >= 0.3.0
42 , http-client >= 0.3.0
43 , http-client-tls >= 0.2.0.0
43 , http-client-tls >= 0.2.0.0
44− , aeson >= 0.7.0.3 && < 1.5.0.0
44+ , aeson >= 0.7.0.3 && < 1.4.0.0
45+ , microlens >= 0.4.0.1
45 , microlens-th >= 0.4.0.0
46 , microlens-th >= 0.4.0.0
46 , blaze-html >= 0.5.0.0
47 , blaze-html >= 0.5.0.0
47 , QuickCheck >= 2.6 && < 3.0
48 , QuickCheck >= 2.6 && < 3.0
src/Network/API/Mandrill.hs+6−7
@@ -26,6 +26,7 @@ import qualified Data.HashMap.Strict as H
26import Data.Monoid
26import Data.Monoid
27import qualified Data.Text as T
27import qualified Data.Text as T
28import Data.Time
28import Data.Time
29+import Lens.Micro
29import Network.API.Mandrill.Messages as M
30import Network.API.Mandrill.Messages as M
30import Network.API.Mandrill.Messages.Types as M
31import Network.API.Mandrill.Messages.Types as M
31import Network.API.Mandrill.Trans as M
32import Network.API.Mandrill.Trans as M
@@ -106,7 +107,7 @@ newHtmlMessage :: EmailAddress
106 -- ^ The HTML body
107 -- ^ The HTML body
107 -> MandrillMessage
108 -> MandrillMessage
108newHtmlMessage f t subj html = let body = mkMandrillHtml html in
109newHtmlMessage f t subj html = let body = mkMandrillHtml html in
109− (emptyMessage f t) { _mmsg_html = body, _mmsg_subject = subj }
110+ ((mmsg_html .~ body) . (mmsg_subject .~ subj)) $ (emptyMessage f t)
110
111
111--------------------------------------------------------------------------------
112--------------------------------------------------------------------------------
112-- | Create a new template message (no HTML).
113-- | Create a new template message (no HTML).
@@ -117,7 +118,7 @@ newTemplateMessage :: EmailAddress
117 -> T.Text
118 -> T.Text
118 -- ^ Subject
119 -- ^ Subject
119 -> MandrillMessage
120 -> MandrillMessage
120−newTemplateMessage f t subj = (emptyMessage f t) { _mmsg_subject = subj }
121+newTemplateMessage f t subj = (mmsg_subject .~ subj) $ (emptyMessage f t)
121
122
122--------------------------------------------------------------------------------
123--------------------------------------------------------------------------------
123-- | Create a new textual message. By default Mandrill doesn't require you
124-- | Create a new textual message. By default Mandrill doesn't require you
@@ -133,11 +134,9 @@ newTextMessage :: EmailAddress
133 -- ^ The body, as normal text.
134 -- ^ The body, as normal text.
134 -> MandrillMessage
135 -> MandrillMessage
135newTextMessage f t subj txt = let body = unsafeMkMandrillHtml txt in
136newTextMessage f t subj txt = let body = unsafeMkMandrillHtml txt in
136− (emptyMessage f t) {
137+ ((mmsg_html .~ body) .
137− _mmsg_html = body
138− , _mmsg_text = Just txt
138+ (mmsg_text .~ Just txt) .
139− , _mmsg_subject = subj
139+ (mmsg_subject .~ subj)) (emptyMessage f t)
140− }
141
140
142
141
143--------------------------------------------------------------------------------
142--------------------------------------------------------------------------------
src/Network/API/Mandrill/Types.hs−5
@@ -158,11 +158,6 @@ unsafeMkMandrillHtml = MandrillHtml . Blaze.preEscapedToHtml
158mkMandrillHtml :: Blaze.Html -> MandrillHtml
158mkMandrillHtml :: Blaze.Html -> MandrillHtml
159mkMandrillHtml = MandrillHtml
159mkMandrillHtml = MandrillHtml
160
160
161−#if MIN_VERSION_base(4,11,0)
162−instance Semigroup MandrillHtml where
163− MandrillHtml m1 <> MandrillHtml m2 = MandrillHtml (m1 <> m2)
164−#endif
165−
166instance Monoid MandrillHtml where
161instance Monoid MandrillHtml where
167 mempty = MandrillHtml mempty
162 mempty = MandrillHtml mempty
168 mappend (MandrillHtml m1) (MandrillHtml m2) = MandrillHtml (m1 <> m2)
163 mappend (MandrillHtml m1) (MandrillHtml m2) = MandrillHtml (m1 <> m2)
stack.yaml+1−1
@@ -2,4 +2,4 @@ flags: {}
2packages:
2packages:
3- '.'
3- '.'
4extra-deps: []
4extra-deps: []
5−resolver: lts-11.13
5+resolver: lts-5.2