Official SendGrid NodeJS library.
This library allows you to quickly and easily use the SendGrid Web API v3 via Node.js.
This library represents the beginning of a new path for SendGrid. We want this library to be community driven and SendGrid led. We need your help to realize this goal. To help make sure we are building the right things in the right order, we ask that you create issues and pull requests or simply upvote or comment on existing issues or pull requests.
Please browse the rest of this README for further detail.
We appreciate your continued support, thank you!
Update the development environment with your SENDGRID_API_KEY, for example:
echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.envecho "sendgrid.env" >> .gitignoresource ./sendgrid.env
Add the following to your
Install sendgrid-nodejs and its dependencies:
You can also install sendgrid locally with the following command:
npm install sendgrid
var helper = mail;var from_email = 'firstname.lastname@example.org';var to_email = 'email@example.com';var subject = 'Hello World from the SendGrid Node.js Library!';var content = 'text/plain' 'Hello, Email!';var mail = from_email subject to_email content;var sg = processenvSENDGRID_API_KEY;var request = sg;sg;
The following is the minimum needed code to send an email without the /mail/send Helper (here is a full example):
var sg = processenvSENDGRID_API_KEY;var request = sg;//With promisesg;//With callbacksg;
var sg = processenvSENDGRID_API_KEY// GET Collectionvar request = sg;//With promisesg;//With callbacksg
Examples of common API use cases, such as how to send an email with a transactional template.
We encourage contribution to our libraries (you might even score some nifty swag), please see our CONTRIBUTING guide for details.
Please see our troubleshooting guide for common library issues.
sendgrid-nodejs is guided and supported by the SendGrid Developer Experience Team.
sendgrid-nodejs is maintained and funded by SendGrid, Inc. The names and logos for sendgrid-nodejs are trademarks of SendGrid, Inc.
![SendGrid Logo] (https://uiux.s3.amazonaws.com/2016-logos/email-logo%402x.png)