Skip to content

Instantly share code, notes, and snippets.

@nicooprat
Created June 13, 2020 08:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nicooprat/19113bb109befec4dfb25cb0611e8b37 to your computer and use it in GitHub Desktop.
Save nicooprat/19113bb109befec4dfb25cb0611e8b37 to your computer and use it in GitHub Desktop.
Send a mail through Mailjet
const mailjet = nodeMailjet.connect(process.env.MAILJET_PUBLIC, process.env.MAILJET_PRIVATE)
// Send through Mailjet
mailjet.post('send', { version: 'v3.1' }).request({
Messages: [{
From: {
Email: sender.email,
Name: sender.name,
},
Subject: i18n.t('emails.a1.subject', { app: config.app }),
To: [{
Email: recipient.email,
Name: recipient.name,
}],
HTMLPart: html,
}]
})
.then(res => {
//console.log(res)
})
.catch(err => {
//console.error(err)
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment