I am writing a nodejs application that will send an html email address using emailjs . Basically I provide html to send as a variable that I am attaching to the post.
Instead of creating this variable using a lot of string concatenation, I would just like to visualize the view with express / ejs and save the contents to the variable.
So instead:
messageHtml = '<html>'+ .... message.attach({data: messageHtml, alternative: true});
I would like to do something like:
messageHtml = render('emailTemplate.ejs', viewArgs); message.attach({data: messageHtml, alternative: true});
Can this be done, and if so, how ?!
Zugwalt
source share