git.iko.soy/typeable/mandrill
on master help sign in
6 files changed+19−9
since splitsnapshots
unifiedsplit
.gitignore+1 README.md+4 mandrill.cabal+1−2 src/Network/API/Mandrill.hs+7−6 src/Network/API/Mandrill/Types.hs+5 stack.yaml+1−1
.gitignore+1
@@ -3,3 +3,4 @@ dist
33cabal.sandbox.config
44shell.nix
55.stack-work
6+tags
README.md+4
@@ -8,6 +8,10 @@ the [Mandrill](http://mandrillapp.com) transactional email service.
88
99# Changelog
1010
11+## Version 0.5.3.5
12+
13+* Replaced dependency on lens with microlens (Courtesy of @tom-bop)
14+
1115## Version 0.5.3.3
1216
1317* Relaxed upper bound on Aeson (see: fpco/stackage/issues/3337)
mandrill.cabal+1−2
@@ -41,8 +41,7 @@ library
4141 , http-types >= 0.8.0
4242 , http-client >= 0.3.0
4343 , http-client-tls >= 0.2.0.0
44− , aeson >= 0.7.0.3 && < 1.4.0.0
45− , microlens >= 0.4.0.1
44+ , aeson >= 0.7.0.3 && < 1.5.0.0
4645 , microlens-th >= 0.4.0.0
4746 , blaze-html >= 0.5.0.0
4847 , QuickCheck >= 2.6 && < 3.0
src/Network/API/Mandrill.hs+7−6
@@ -26,7 +26,6 @@ import qualified Data.HashMap.Strict as H
2626import Data.Monoid
2727import qualified Data.Text as T
2828import Data.Time
29−import Lens.Micro
3029import Network.API.Mandrill.Messages as M
3130import Network.API.Mandrill.Messages.Types as M
3231import Network.API.Mandrill.Trans as M
@@ -107,7 +106,7 @@ newHtmlMessage :: EmailAddress
107106 -- ^ The HTML body
108107 -> MandrillMessage
109108newHtmlMessage 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 }
111110
112111--------------------------------------------------------------------------------
113112-- | Create a new template message (no HTML).
@@ -118,7 +117,7 @@ newTemplateMessage :: EmailAddress
118117 -> T.Text
119118 -- ^ Subject
120119 -> MandrillMessage
121−newTemplateMessage f t subj = (mmsg_subject .~ subj) $ (emptyMessage f t)
120+newTemplateMessage f t subj = (emptyMessage f t) { _mmsg_subject = subj }
122121
123122--------------------------------------------------------------------------------
124123-- | Create a new textual message. By default Mandrill doesn't require you
@@ -134,9 +133,11 @@ newTextMessage :: EmailAddress
134133 -- ^ The body, as normal text.
135134 -> MandrillMessage
136135newTextMessage f t subj txt = let body = unsafeMkMandrillHtml txt in
137− ((mmsg_html .~ body) .
138− (mmsg_text .~ Just txt) .
139− (mmsg_subject .~ subj)) (emptyMessage f t)
136+ (emptyMessage f t) {
137+ _mmsg_html = body
138+ , _mmsg_text = Just txt
139+ , _mmsg_subject = subj
140+ }
140141
141142
142143--------------------------------------------------------------------------------
src/Network/API/Mandrill/Types.hs+5
@@ -158,6 +158,11 @@ unsafeMkMandrillHtml = MandrillHtml . Blaze.preEscapedToHtml
158158mkMandrillHtml :: Blaze.Html -> MandrillHtml
159159mkMandrillHtml = MandrillHtml
160160
161+#if MIN_VERSION_base(4,11,0)
162+instance Semigroup MandrillHtml where
163+ MandrillHtml m1 <> MandrillHtml m2 = MandrillHtml (m1 <> m2)
164+#endif
165+
161166instance Monoid MandrillHtml where
162167 mempty = MandrillHtml mempty
163168 mappend (MandrillHtml m1) (MandrillHtml m2) = MandrillHtml (m1 <> m2)
stack.yaml+1−1
@@ -2,4 +2,4 @@ flags: {}
22packages:
33- '.'
44extra-deps: []
5−resolver: lts-5.2
5+resolver: lts-11.13