@@ -20,7 +20,6 @@ module Network.API.Mandrill (
2020 -- $exampleusage
2121 ) where
2222
23−import Control.Lens
2423import Control.Monad.Reader
2524import qualified Data.Aeson as JSON
2625import qualified Data.HashMap.Strict as H
@@ -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--------------------------------------------------------------------------------