Skip to content

Instantly share code, notes, and snippets.

@mariusa
Last active Aug 13, 2021
Embed
What would you like to do?
NodeX code sample: send email
let html = ''
try {
html = await liquid.renderFile('tpl/email-welcome', {
app_hostname: process.env.APP_HOST,
firstName: user.firstName,
})
} catch (err) {
//no template
return
}
var emailo = {
to: user.email,
subject: 'Welcome!',
body: html,
substitution_data: {},
}
emailo.options = {
transactional: true, //https://www.sparkpost.com/docs/user-guide/remove-list-unsubscribe-header/
open_tracking: true,
}
uti.sendEmail(emailo)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment