Parsing array of data and sending with nodemailer?
<p>I've got an array of data that I want to send in a table using <code>NodeMailer</code> that looks something like:</p>

<pre><code>var results = [ { 
    asin: 'B01571L1Z4',
    url: 'domain.com',
    favourite: false,
    createdAt: 2016-11-18T19:08:41.662Z,
    updatedAt: 2016-11-18T19:08:41.662Z,
    id: '582f51b94581a7f21a884f40' 
  },
  { 
    asin: 'B01IM0K0R2',
    url: 'domain2.com',
    favourite: false,
    createdAt: 2016-11-16T17:56:21.696Z,
    updatedAt: 2016-11-16T17:56:21.696Z,
    id: 'B01IM0K0R2' 
   }]
</code></pre>

<p>What I am trying to do i to create a loop inside my HTML and then loop through the data.  I did try the below, but it seems there are limitations on what I can do.</p>

<pre><code>  var sendUpdatedMerch = transporter.templateSender({
      from: '"Test" &lt;domain1@gmail.com&gt;', // sender address
      subject: 'Test Updates', // Subject line
      html: '&lt;div&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;ASIN&lt;/th&gt;&lt;th&gt;Url&lt;/th&gt;&lt;th&gt;Favourite&lt;/th&gt;&lt;th&gt;createdAt&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;{{result.forEach((item) =&gt; {&lt;tr&gt;&lt;td&gt;{{asin}}&lt;/a&gt;&lt;/td&gt;&lt;td&gt;{{url}&lt;/td&gt;&lt;td&gt;{{favourite}}&lt;/td&gt;&lt;td&gt;{{createdAt}}&lt;/td&gt;&lt;/tr&gt;})}}&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;' // html body
  });

  sendUpdatedMerch({
    to: 'domain@gmail.com'
  }, {results}, function(err, info){
    if(err){
      console.log(err);
    } else {
      console.log('Done');
    }
  })
</code></pre>

<p>Could anyone point out where I am going wrong please and what I need to do to correct my problems.</p>