@team_seki/sendgrid-plugin
v0.1.0
Published
This library was generated with [Nx](https://nx.dev).
Downloads
5
Readme
sendgrid-plugin
This library was generated with Nx.
Usage
Create file sendgrid_default_settings.json
{
"api_key": "your_personal_key"
}
Send email
import { SendgridPlugin } from '@team_seki/sendgrid-plugin'
const sendgrid = new SendgridPlugin().getMailService()
const message =
{
to: '[email protected]',
from: '[email protected]', // Use the email address or domain you verified above
subject: 'Sending with Twilio SendGrid is Fun',
text: 'and easy to do anywhere, even with Node.js',
html: '<strong>and easy to do anywhere, even with Node.js</strong>',
};
sendgrid
.send(message)
.then(() => console.log('Mail sent successfully'))
.catch(error => {
console.error(error);
});
Building
Run nx build sendgrid-plugin
to build the library.
Running unit tests
Run nx test sendgrid-plugin
to execute the unit tests via Jest.