title: How to pass array to Mailgun api via http post in Ionic 5 Application?
body: <p>I am trying to send some images URL to Mailgun API to be used my Mailgun Email Templates variables. But I am unable to figure out how to pass. I can pass single variables using v: but don't know how to pass an array. I have tried passing the javascript object to Http post method but Mailgun API gives &quot;from parameter is missing&quot; error.</p>
  <pre><code>using this way I am able to send data to mailgun api without any issues but don't know how to send array or json object. 
  
  var body = 
              &quot;from=Admin &lt;order@xyz.com&gt;&quot; + 
              &quot;&amp;to=&quot; + recipient + 
              &quot;&amp;subject=Order Placed #&quot; + subject +
              &quot;&amp;template=my-template&quot; + 
              &quot;&amp;v:orderID=&quot; + subject +
              &quot;&amp;v:userEmail=&quot; + JSON.parse(address).email +
              &quot;&amp;v:orderCharges=&quot; + this.price * quantity +
              &quot;&amp;v:frameQuantity=&quot; + quantity +
              &quot;&amp;v:orderShipping=&quot; +  JSON.parse(address).addr +
              &quot;&amp;v:orderImage[]=&quot; + encodeURI (message[0]) + &quot;,&quot; + encodeURI(message[1]);
  
          var url = &quot;https://api.mailgun.net/v3/&quot; + this.mailgunUrl + &quot;/messages&quot;;
  
          this.http.post(url,body, 
          {
                  headers: { 'Authorization': 'Basic ' + this.mailgunApiKey, &quot;Content-Type&quot;: &quot;application/x-www-form-urlencoded&quot; },
              }).subscribe(res =&gt; {
                  console.log('THIS IS EMAIL RES', res);
              })
      }
  </code></pre>
  <p>When I try to pass an object like this:</p>
  <pre><code>{
      &quot;from&quot;:&quot;order@xyz.com&quot;,
      &quot;to&quot;: &quot;xxxxx@gmail.com&quot;,
      &quot;subject&quot;: &quot;Order Placed #46&quot;,
      &quot;template&quot;: &quot;my-template&quot;,
      &quot;v:orderID&quot;: 46
  }
  </code></pre>
  <p>Mailgun API gives me error &quot;from parameter is missing. I have trying from:order@xyz.com as well. Even tried passing json object after url to post but still same error.</p>
  <p>I have managed to send data to mailgun api by constructing the body as shown above but now I don't know how to pass array because I don't know how many images user will select. So I want an array to be used by Handlebars.js each loop to translate variables into data.</p>