Q:

Can't get merge tags to work - Mandrill/Parse

Here's my Parse Cloud Code call:
 Mandrill.sendTemplate({
    "template_name": "start-conversation",
    "template_content": [{
        "name": "example name",
        "content": "example content" //Those are required but they are ignored
    }],
    "message": {
        "to": [{
            "email": request.params.toUserEmail,
            "name": request.params.toUserName
        }],
        "important": true, 
        "merge": true,
        "global_merge_vars": [
            {
                "rcpt": request.params.toUserEmail,
                "vars": [
                    {
                        "name": "TOUSERNAME",
                        "content": request.params.toUserName
                    },
                    {
                        "name": "FROMUSERNAME",
                        "content": request.params.fromUserName
                    },
                    {
                        "name": "TOPICNAME",
                        "content": request.params.topicName
                    },
                     {
                        "name": "LANGUAGE",
                        "content": request.params.language
                    }
                ]
            }
        ],
    },

  "async": true
},{
  success: function(httpResponse) {
    console.log(httpResponse);
    response.success("mandrillStartConvoRequest -- success -- Email sent!");
  },
  error: function(httpResponse) {
    console.error(httpResponse);
    response.error("mandrillStartConvoRequest -- error -- Uh oh, something went wrong");
  }
});

Here's the <span> with the tags in my Mandrill Template:
 <span style="line-height:20.7999992370605px">
 *|TOUSERNAME|*
 <br><br>
 *|FROMUSERNAME|* would like to start a conversation with you about *|TOPICNAME|* in *|LANGUAGE|*     </span>

The e-mail sends fine but no merge =(:

A:

as far as I know the built-in Mandrill.sendTemplate method does not work.
so you should try to call mandrill API yourself, just do a HTTP POST
https://parse.com/questions/send-mandrill-template-email-from-cloud-code-example-code-required
UPDATE:
what I am using in my project is something like this, notice that I am using merge_vars but you are using global_merge_vars
        var params = {
          key: "xxxxxxxxxxxx",
          template_name: "$template_name",
          template_content: [],
          message: {
            to: [
              {
                email: email
              }
            ],
            merge_vars : [{
              rcpt: email,
              vars:[
                {
                  "name" : "from",
                  "content" : "Test"
                }
              ]
            }]
          },
          async: true
        };

        Parse.Cloud.httpRequest({
          method: "POST",
          headers: {
            "Content-Type": "application/json",
          },
          url: "https://mandrillapp.com/api/1.0/messages/send-template.json",
          body: params,
          success: function(httpResponse) {
              response.success("email sent");
            },
          error: function(httpResponse) {
              console.error(httpResponse);
              response.error("Uh oh, something went wrong");
            }
        });

