Create, preview (browser/iOS Simulator), and send custom email templates for Node.js. Made for @forwardemail, @ladjs, @cabinjs, @spamscanner, and @breejs.
This is most likely a configuration issue or an issue with consolidate package? I think we have some examples/tests that do EJS if you want to look through them.
So i tried to follow the getting started docs and I got the pug version to work correctly, but it doesnt seem to working for other templating engines.
Here is my code not sure what Im doing wrong. I also followed the directory structure /root/emails/name-of-template
html.ejs `
Hello
subject.ejs
<%=STRING
%> `email.js `import Email from 'email-templates'; import nodemailer from 'nodemailer';
const transporter = nodemailer.createTransport({ host: 'smtp.mailtrap.io', port: 465, secure: false, auth: { user: pass: } });
export const email = new Email({ send: true, transport: transporter, preview: false });
export const sendEmail = () => { email .send({ template: 'password', message: { from: 'Steve Milburn no-reply@blog.com', to: 'john@snow.com' //subject: 'EEEEEE' }, locals: { fname: 'John', lname: 'Snow' }, views: { options: { extension: 'ejs' } } }) .then(() => console.log('email has been sent!')); }; `