@@ -177,11 +177,20 @@ type MandrillHeaders = Object
177--------------------------------------------------------------------------------
177--------------------------------------------------------------------------------
178type MandrillVars = Value
178type MandrillVars = Value
180+--------------------------------------------------------------------------------
182+data MergeVar = MergeVar {
184+ , _mv_content :: Value
187+makeLenses ''MergeVar
188+deriveJSON defaultOptions { fieldLabelModifier = drop 4 } ''MergeVar
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
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.