6

On Mandrill's Template API page, I plug in the following JSON to test the Render method upon clicking "Try it":

{
    "key": "MY VALID KEY",
    "template_name": "test1",
    "template_content": [

    ],
    "merge_vars": [
        {
            "name": "invoice_number",
            "content": "1001"
        }
    ]
}

The test results come back with my template but the one merge_var I'm testing has not been merged, i.e. the result still contains {{invoice_number}}:

{
    "html": "<p style=\"font-family: sans-serif;\">Dear Customer,</p>\r\n\r\n<p style=\"font-family: sans-serif;\">Invoice {{invoice_number}} ...</p>"
}

Does Mandrill's Render API ignore merge_vars that map to Handlebars variables?

flipdoubt
  • 13,897
  • 15
  • 64
  • 96

1 Answers1

5

According to Mandrill support:

As you noticed, the render API call does not currently support Handlebars templates. While I can't provide an exact ETA for when the render API call will work with Handlebars, I can tell you that it's something that our developers are working to extend support for very soon.

I would suggest keeping an eye on our Mandrill API Documentation as that support will be noted there as an additional parameter for the call as soon as it is supported.

flipdoubt
  • 13,897
  • 15
  • 64
  • 96
  • Bummer, render(..) still does not support merge_language parameter. – warriorpostman Oct 09 '17 at 04:29
  • It's now clearly stated in documentation, that per-recipient merge variables override global merge variables with the same name, but when POSTing json with vars the variable is still empty in my template. merge_vars: [ { "rcpt": "me@gmail.com", "vars": [ { "name": "firstName", "content": "firstName" } } ] Global vars work fine. What could be the case? – kaiak Jun 08 '21 at 11:43