@@ -20,7 +20,6 @@ module Network.API.Mandrill (
20 -- $exampleusage
20 -- $exampleusage
24import Control.Monad.Reader
23import Control.Monad.Reader
25import qualified Data.Aeson as JSON
24import qualified Data.Aeson as JSON
26import qualified Data.HashMap.Strict as H
25import qualified Data.HashMap.Strict as H
@@ -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 }
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 }
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) {
138− (mmsg_text .~ Just txt) .
138+ , _mmsg_text = Just txt
139− (mmsg_subject .~ subj)) (emptyMessage f t)
139+ , _mmsg_subject = subj
142--------------------------------------------------------------------------------
143--------------------------------------------------------------------------------