Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
NodeX code sample: send email
let email = {
to: u.email,
name: u.name,
subject: 'Your newsletter',
substitution_data: {
first_name: u.first_name,
unsubscribe_link: 'https://' + process.env.APP_HOSTNAME + '/api/unsubscribe?u=' + u.id + '&t=' + u.unsubscribe_token,
highlights: Common.nl2br(highlights_html)
},
body: `Hey {{first_name}},
Here are your highlights for today!
{{{highlights}}}
— The team
<a href="{{{unsubscribe_link}}}">Unsubscribe</a>
`
}
email.body = Common.nl2br(email.body)
Common.sendEmail(email)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.