use lodash template with nodemailer
<p>I'm using 'lodash.template' like this</p>

<pre><code>var compiled = _.template('&lt;% _.forEach(image, function(image) { %&gt;&lt;td&gt;&lt;img src="https://s3.amazonaws.com/&lt;%- image.image %&gt;"&lt;/td&gt;&lt;% }); %&gt;');
</code></pre>

<p>I then generate emailHTML like this</p>

<pre><code>res.render('templates/reset-password-email', {
          name: name,
          qc: qc,
          images: compiled(qc),
          appName: appName
        }, function (err, template) {
          if (err) {
            console.log(err)
          }
          emailHTML = template;
          callback(null, arr);
        });
</code></pre>

<p>I then send email like this</p>

<pre><code>var smtpTransport = nodemailer.createTransport(config.mailer.options);

      var mailOptions = {
        to: 'user@email.com',
        from: config.mailer.from,
        subject: 'subjet',
        attachments: [
          {
            path: filePath
          }
        ],
        html: emailHTML
      };
      smtpTransport.sendMail(mailOptions, function (err) {
        if (err) {
          console.log(err);
        }
        //done(err, 'done');
      });
</code></pre>

<p>The problem that I'm having is that {{images}} which is the compiled lodash.template is being displayed as text instead of Html. For example the html below is being displayed as text not as html.</p>

<pre><code>&lt;td&gt;&lt;img src="https://s3.amazonaws.com/8e580-b7e3-11e6-bea-c3c74fd.jpg"&lt;/td&gt;
</code></pre>

<p>Can someone please help me figure out what I'm doing wrong. As always thank you for your help</p>