I've just inherited a codebase, and it's using handlebars as an email templating language.
I've googled around to try and get more information, but I can't find anyone else doing this.
I was just wondering if anyone could supply me some documentation or search terms to look for. I had no idea you could even use handlebars like this!
Thanks,
Ollie
Email sender
// Send new account email
function sendNewAccountEmail(expert) {
...
return handlebars.render('views/emails/newAccountEmail.handlebars', {
name: `${expert.firstName} ${expert.lastName}`,
layout: false,
expert,
url: `${LIVE_URL}/expert/reset/${expert.resetPasswordToken}`,
}).then(email => new Promise((resolve, reject) => {
sendmail({
from: SEND_EMAIL,
to: recipient,
subject: '',
text: email,
}, (err, reply) => {
...
});
})); }
newAccountEmail.handlebars
Hi {{name}},
You now have access to RARA Survey tool!
You can now access your dashboard and assigned campaigns by going to the following link and creating a password:
Login URL: {{url}}
Thanks!
Influencer Team