Skip to content

Instantly share code, notes, and snippets.

@batasrki
Last active December 20, 2015 02:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save batasrki/6056671 to your computer and use it in GitHub Desktop.
Save batasrki/6056671 to your computer and use it in GitHub Desktop.
Mandrill API brokenness
{
"template_name": "verification",
"template_content": null,
"merge_vars": [
{
"vars": [
{
"name": "name",
"content": "Test Me"
},
{
"name": "link",
"content": "http://this.com/is/a/link"
}
]
}
],
"key": "6jBS1qHLdImqL3GfaHxH-Q"
}
//response
{"html"=>"Hey *|name|*,\r\n\r\nThank you for signing up with our cool thing, your destination to all the cool things.\r\n\r\nPlease verify your e-mail by clicking on the following link, *|link|*"}
#call that works right now
m.templates.render 'verification',
nil,
[
{
:name => 'name',
:content => 'Test Me'
},
{
:name => 'link',
:content =>'http://this.com/is/a/link'
}
]
#call that should work according to documentation, http://help.mandrill.com/entries/21678522-How-do-I-use-merge-tags-to-add-dynamic-content-
m.templates.render 'verification',
nil,
[
{
:rcpt => "test@user.ca",
:vars => [
{
:name => 'name',
:content => 'Test Me'
},
{
:name => 'link',
:content =>'http://this.com/is/a/link'
}
]
}
]
Hey *|name|*,
Thank you for signing up with iFestivus, your destination to all the cool festivals.
Please verify your e-mail by clicking on the following link, *|link|*
{
"template_name": "verification",
"template_content": null,
"merge_vars": [
{
"name": "name",
"content": "Test Me"
},
{
"name": "link",
"content": "http://this.com/is/a/link"
}
],
"key": "6jBS1qHLdImqL3GfaHxH-Q"
}
//response, expected in all 3 cases
{"html"=>"Hey Test Me,\r\n\r\nThank you for signing up with our cool thing, your destination to all the cool things.\r\n\r\nPlease verify your e-mail by clicking on the following link, http://this.com/is/a/link"}
{
"template_name": "verification",
"template_content": null,
"merge_vars": [
{
"rcpt": "test@user.ca",
"vars": [
{
"name": "name",
"content": "Test Me"
},
{
"name": "link",
"content": "http://this.com/is/a/link"
}
]
}
],
"key": "6jBS1qHLdImqL3GfaHxH-Q"
}
//response
{"html"=>"Hey *|name|*,\r\n\r\nThank you for signing up with our cool thing, your destination to all the cool things.\r\n\r\nPlease verify your e-mail by clicking on the following link, *|link|*"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment