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
commit609b184c6a94fad107b06b097a423a2b818440be authorBas van Dijk <v.dijk.bas@gmail.com> dateFri 2 Oct 2015, 12:07 (11 years ago) parent7968381
2 files changed+24−4
README.md+13−2 src/Network/API/Mandrill/Types.hs+11−2
README.md+13−2
@@ -10,9 +10,20 @@ the [Mandrill](http://mandrillapp.com) transactional email service.
1010
1111## Version 0.5.0.0
1212
13−* Changed the MandrillHeaders type synonym from Value to Object.
13+* Changed the `MandrillHeaders` type synonym from `Value` to `Object`.
1414
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+```
1627
1728## Version 0.4.0.0
1829
src/Network/API/Mandrill/Types.hs+11−2
@@ -177,11 +177,20 @@ type MandrillHeaders = Object
177177--------------------------------------------------------------------------------
178178type MandrillVars = Value
179179
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
180189
181190--------------------------------------------------------------------------------
182191data MandrillMergeVars = MandrillMergeVars {
183192 _mmvr_rcpt :: !T.Text
184− , _mmvr_vars :: [MandrillVars]
193+ , _mmvr_vars :: [MergeVar]
185194 } deriving Show
186195
187196makeLenses ''MandrillMergeVars
@@ -275,7 +284,7 @@ data MandrillMessage = MandrillMessage {
275284 -- ^ whether to evaluate merge tags in the message.
276285 -- Will automatically be set to true if either merge_vars
277286 -- or global_merge_vars are provided.
278− , _mmsg_global_merge_vars :: [MandrillVars]
287+ , _mmsg_global_merge_vars :: [MergeVar]
279288 -- ^ global merge variables to use for all recipients. You can override these per recipient.
280289 , _mmsg_merge_vars :: [MandrillMergeVars]
281290 -- ^ per-recipient merge variables, which override global merge variables with the same name.