magic-email
v1.0.4
Published
SDK to send email with nodemailer and sendGrid
Downloads
2
Readme
✨magic-email ✨
This library allows you to quickly and easily send emails.
Features
- Send email with NodeMailer
- Send email with SendGrid
Installation
To install in your project
$ npm install magic-email
How to use
const magicEmail = require('magic-email');
// To use NodeMailer
strategyParams = {
strategyName: 'NodeMailer',
smtp: {
host: HOST,
port: PORT,
user: USER,
password: PASSWORD
}
}
// To use SendGrid
strategyParams = {
strategyName: 'SendGrid',
apiKey: API_KEY
}
senderParams = {
senderName: 'Sender Name',
senderEmail: '[email protected]'
}
emailParams = {
to: '[email protected]',
cc: '[email protected]',
bcc: '[email protected]',
subject: 'This is the Subject',
html: '<b> This is the HTML content</b>'
}
magicEmail.sendEmail(strategyParams, senderParams, emailParams);