Created
June 13, 2020 08:46
-
-
Save nicooprat/19113bb109befec4dfb25cb0611e8b37 to your computer and use it in GitHub Desktop.
Send a mail through Mailjet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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