git.iko.soy/typeable/mandrill
on master help sign in
.gitignore+1
since splitsnapshots
unifiedsplit
@@ -3,3 +3,4 @@ dist
3cabal.sandbox.config
3cabal.sandbox.config
4shell.nix
4shell.nix
5.stack-work
5.stack-work
6+tags
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.3.5
12+
13+* Replaced dependency on lens with microlens (Courtesy of @tom-bop)
14+
11## Version 0.5.3.3
15## Version 0.5.3.3
12
16
13* Relaxed upper bound on Aeson (see: fpco/stackage/issues/3337)
17* Relaxed upper bound on Aeson (see: fpco/stackage/issues/3337)
mandrill.cabal+1−2
@@ -41,8 +41,7 @@ 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.4.0.0
44+ , aeson >= 0.7.0.3 && < 1.5.0.0
45− , microlens >= 0.4.0.1
46 , microlens-th >= 0.4.0.0
45 , microlens-th >= 0.4.0.0
47 , blaze-html >= 0.5.0.0
46 , blaze-html >= 0.5.0.0
48 , QuickCheck >= 2.6 && < 3.0
47 , QuickCheck >= 2.6 && < 3.0
src/Network/API/Mandrill.hs+7−6
@@ -26,7 +26,6 @@ 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
30import Network.API.Mandrill.Messages as M
29import Network.API.Mandrill.Messages as M
31import Network.API.Mandrill.Messages.Types as M
30import Network.API.Mandrill.Messages.Types as M
32import Network.API.Mandrill.Trans as M
31import Network.API.Mandrill.Trans as M
@@ -107,7 +106,7 @@ newHtmlMessage :: EmailAddress
107 -- ^ The HTML body
106 -- ^ The HTML body
108 -> MandrillMessage
107 -> MandrillMessage
109newHtmlMessage f t subj html = let body = mkMandrillHtml html in
108newHtmlMessage f t subj html = let body = mkMandrillHtml html in
110− ((mmsg_html .~ body) . (mmsg_subject .~ subj)) $ (emptyMessage f t)
109+ (emptyMessage f t) { _mmsg_html = body, _mmsg_subject = subj }
111
110
112--------------------------------------------------------------------------------
111--------------------------------------------------------------------------------
113-- | Create a new template message (no HTML).
112-- | Create a new template message (no HTML).
@@ -118,7 +117,7 @@ newTemplateMessage :: EmailAddress
118 -> T.Text
117 -> T.Text
119 -- ^ Subject
118 -- ^ Subject
120 -> MandrillMessage
119 -> MandrillMessage
121−newTemplateMessage f t subj = (mmsg_subject .~ subj) $ (emptyMessage f t)
120+newTemplateMessage f t subj = (emptyMessage f t) { _mmsg_subject = subj }
122
121
123--------------------------------------------------------------------------------
122--------------------------------------------------------------------------------
124-- | Create a new textual message. By default Mandrill doesn't require you
123-- | Create a new textual message. By default Mandrill doesn't require you
@@ -134,9 +133,11 @@ newTextMessage :: EmailAddress
134 -- ^ The body, as normal text.
133 -- ^ The body, as normal text.
135 -> MandrillMessage
134 -> MandrillMessage
136newTextMessage f t subj txt = let body = unsafeMkMandrillHtml txt in
135newTextMessage f t subj txt = let body = unsafeMkMandrillHtml txt in
137− ((mmsg_html .~ body) .
136+ (emptyMessage f t) {
137+ _mmsg_html = body
138− (mmsg_text .~ Just txt) .
138+ , _mmsg_text = Just txt
139− (mmsg_subject .~ subj)) (emptyMessage f t)
139+ , _mmsg_subject = subj
140+ }
140
141
141
142
142--------------------------------------------------------------------------------
143--------------------------------------------------------------------------------
src/Network/API/Mandrill/Types.hs+5
@@ -158,6 +158,11 @@ 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+
161instance Monoid MandrillHtml where
166instance Monoid MandrillHtml where
162 mempty = MandrillHtml mempty
167 mempty = MandrillHtml mempty
163 mappend (MandrillHtml m1) (MandrillHtml m2) = MandrillHtml (m1 <> m2)
168 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-5.2
5+resolver: lts-11.13