Last active
December 20, 2015 02:29
-
-
Save batasrki/6056671 to your computer and use it in GitHub Desktop.
Mandrill API brokenness
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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|*"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 => "[email protected]", | |
:vars => [ | |
{ | |
:name => 'name', | |
:content => 'Test Me' | |
}, | |
{ | |
:name => 'link', | |
:content =>'http://this.com/is/a/link' | |
} | |
] | |
} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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|* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"template_name": "verification", | |
"template_content": null, | |
"merge_vars": [ | |
{ | |
"rcpt": "[email protected]", | |
"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