You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was having some trouble getting this library to work with templates that were using handlebars for Mandrill.
After looking into the issue, it seems like the root of the issue is that Handlebars expects the variables to be structured slightly differently from the way gochimp is structuring them.
As mentioned in the blog post, a handlebars template expects pure key/value pairs to be in global_merge_vars, and expects {email: {key: value}} pairs for the merge_vars paramater.
Whereas the TemplateRender in gochimp seems to hand off two paramaters, content and merge_vars, both of which are simple key/value pairs.
(This is my best estimation as to why I was getting blank variables in my templates, and will be investigating further in the next few days, but the above seems like it could be the root of the issue).
The text was updated successfully, but these errors were encountered:
Hmmm...there seems to be a conflict with the API Mandrill has laid out, which does not have a provison for a "global_merge_vars" in the template render request. I'm at a loss for where the disconnect is.
@Marlon-Monroy it's been a while and I switched away from Mandrill a while ago, so I don't remember exactly, but IIRC, I just put the keys and values into the merge_vars map, which I think was made available for each email. So it doesn't have a global_merge_vars but the email specific merge vars are available for each.
But, take that with a grain of salt, as it's been two years since I touched any of this, and migrated away from the implementation probably at least a year ago.
I was having some trouble getting this library to work with templates that were using handlebars for Mandrill.
After looking into the issue, it seems like the root of the issue is that Handlebars expects the variables to be structured slightly differently from the way gochimp is structuring them.
As mentioned in the blog post, a handlebars template expects pure key/value pairs to be in
global_merge_vars
, and expects{email: {key: value}}
pairs for themerge_vars
paramater.Whereas the
TemplateRender
in gochimp seems to hand off two paramaters,content
andmerge_vars
, both of which are simple key/value pairs.(This is my best estimation as to why I was getting blank variables in my templates, and will be investigating further in the next few days, but the above seems like it could be the root of the issue).
The text was updated successfully, but these errors were encountered: