git.iko.soy/typeable/mandrill
on master help sign in
Added the `MergeVar` data type and use it for mmsg_global_merge_vars and mmvr_vars
609b184Bas van Dijk
README.md+13−2
@@ -10,9 +10,20 @@ the [Mandrill](http://mandrillapp.com) transactional email service.
10
10
11## Version 0.5.0.0
11## Version 0.5.0.0
12
12
13−* Changed the MandrillHeaders type synonym from Value to Object.
13+* Changed the `MandrillHeaders` type synonym from `Value` to `Object`.
14
14
15−* Changed the mmsg\_metadata and mmdt_values fields from MandrillVars to Object.
15+* Changed the `mmsg_metadata` and `mmdt_values` fields from `MandrillVars` to `Object`.
16+
17+* Changed the `mmsg_global_merge_vars` and `mmvr_vars` fields from `[MandrillVars]` to `[MergeVar]`
18+
19+* Added the `MergeVar` data type:
20+
21+```haskell
22+data MergeVar = MergeVar {
23+ _mv_name :: !Text
24+ , _mv_content :: Value
25+ }
26+```
16
27
17## Version 0.4.0.0
28## Version 0.4.0.0
18
29
src/Network/API/Mandrill/Types.hs+11−2
@@ -177,11 +177,20 @@ type MandrillHeaders = Object
177--------------------------------------------------------------------------------
177--------------------------------------------------------------------------------
178type MandrillVars = Value
178type MandrillVars = Value
179
179
180+--------------------------------------------------------------------------------
181+
182+data MergeVar = MergeVar {
183+ _mv_name :: !T.Text
184+ , _mv_content :: Value
185+ } deriving Show
186+
187+makeLenses ''MergeVar
188+deriveJSON defaultOptions { fieldLabelModifier = drop 4 } ''MergeVar
180
189
181--------------------------------------------------------------------------------
190--------------------------------------------------------------------------------
182data MandrillMergeVars = MandrillMergeVars {
191data MandrillMergeVars = MandrillMergeVars {
183 _mmvr_rcpt :: !T.Text
192 _mmvr_rcpt :: !T.Text
184− , _mmvr_vars :: [MandrillVars]
193+ , _mmvr_vars :: [MergeVar]
185 } deriving Show
194 } deriving Show
186
195
187makeLenses ''MandrillMergeVars
196makeLenses ''MandrillMergeVars
@@ -275,7 +284,7 @@ data MandrillMessage = MandrillMessage {
275 -- ^ whether to evaluate merge tags in the message.
284 -- ^ whether to evaluate merge tags in the message.
276 -- Will automatically be set to true if either merge_vars
285 -- Will automatically be set to true if either merge_vars
277 -- or global_merge_vars are provided.
286 -- or global_merge_vars are provided.
278− , _mmsg_global_merge_vars :: [MandrillVars]
287+ , _mmsg_global_merge_vars :: [MergeVar]
279 -- ^ global merge variables to use for all recipients. You can override these per recipient.
288 -- ^ global merge variables to use for all recipients. You can override these per recipient.
280 , _mmsg_merge_vars :: [MandrillMergeVars]
289 , _mmsg_merge_vars :: [MandrillMergeVars]
281 -- ^ per-recipient merge variables, which override global merge variables with the same name.
290 -- ^ per-recipient merge variables, which override global merge variables with the same name.