I send email notifications to my users from my app but currently I only send it as a text. I would like to send it HTML emails which are styled.
Currently I tried this:
var data = {
from: 'my app',
to: user.email,
subject: 'Welcome',
html: '<div style="width: 500px; height: 400px: background: #ebebeb; color: #ddd"><p>Hi + "user.firstName" + \n ,this email is to inform you that has added their bio to the knowledge Base \n</p></div>'
};
Compiling the above code does not work, it does not like the styles I have put in. I have created a separate HTML file within my local directory for each type of email I want send and I would like to be able to attach that html file to my email.
Something like this:
var data = {
from: 'my app',
to: user.email,
subject: 'Welcome',
html: welcomeToSiteEmail.html
};
Is the above possible? Any help will be greatly appreciated.