I've made a google cloud function in which I send an email with some variables I receive from another place.
I'm using *[mailgun.js](https://github.com/mailgun/mailgun-js)* and I'm trying to send the email with a template I've already created in mailgun. 
The issue is that I can't find a way to replace the placeholder variables in my template.

This is the code:

```
mg.messages.create('domain', {
    from: 'email',
    to: [email],
    subject: 'subject',
    template: 'template',
    // How to replace the template variables???
  })
  .then(res => console.log('Resolved >>>>> ', res))
  .catch(err => console.log('MAILGUN ERROR >>>> ', err))

```

The [mailgun docs](https://documentation.mailgun.com/en/latest/user_manual.html#templates) says this:

```
var data = {
  from: 'Excited User <me@samples.mailgun.org>',
  to: 'alice@example.com',
  subject: 'Hello',
  template: 'template.test',
  h:X-Mailgun-Variables: '{"title": "API Documentation", "body": "Sending messages with templates"}' // Notice this
};

```

As far as I know one cannot write "`h:X-Mailgun-Variables`" as a key in any object.

Does anybody know where or how do I need to put it?

I thought that it should be sent as a header but neither *[mailgun/mailgun-js](https://github.com/mailgun/mailgun-js)* nor *[highlycaffeinated/mailgun-js](https://github.com/highlycaffeinated/mailgun-js)* specifies how to pass headers.