SendGrid's smtpapi library in NodeJS
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.github
examples
lib
test
.codeclimate.yml
.env_sample
.esdoc.json
.gitignore
.travis.yml
CHANGELOG.md
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE.txt Update LICENSE.txt Oct 1, 2018
README.md
TROUBLESHOOTING.md
USAGE.md
package.json

README.md

SendGrid Logo

BuildStatus npm Email Notifications Badge MIT licensed Twitter Follow GitHub contributors

This node module allows you to quickly and more easily generate SendGrid X-SMTPAPI headers.

Announcements

NEW: If you're a software engineer who is passionate about #DeveloperExperience and/or #OpenSource, this is an incredible opportunity to join our #DX team as a Developer Experience Engineer and work with @thinkingserious and @aroach! Tell your friends :)

All updates to this module are documented in our CHANGELOG.

Table of Contents

Installation

Prerequisites

  • Node.js version 0.10, 0.12 or 4
  • The SendGrid service, starting at the free level

Environment Variables

Update your environment with your SendGrid credentials. (if you will be sending via nodemailer or other SMTP transport)

echo "export SENDGRID_USERNAME='YOUR_USERNAME'" > sendgrid.env
echo "export SENDGRID_PASSWORD='YOUR_PASSWORD'" >> sendgrid.env
echo "sendgrid.env" >> .gitignore
source ./sendgrid.env

The following recommended installation requires npm. If you are unfamiliar with npm, see the npm docs. Npm comes installed with Node.js since node version 0.8.x therefore you likely already have it.

Add the following to your package.json file:

{
  ...
  "dependencies": {
    ...
    "smtpapi": "1.3.1"
  }
}

Install smtpapi-nodejs and its dependencies:

npm install

Dependencies

Quick Start

var smtpapi   = require('smtpapi');
var header    = new smtpapi();
header.addTo('test@example.com');
header.setUniqueArgs({cow: 'chicken'});
console.log(header.jsonString());

Usage

Roadmap

If you are interested in the future direction of this project, please take a look at our milestones. We would love to hear your feedback.

How to Contribute

We encourage contribution to our projects, please see our CONTRIBUTING guide for details.

Quick links:

About

smtpapi-nodejs is guided and supported by the SendGrid Developer Experience Team.

smtpapi-nodejs is maintained and funded by SendGrid, Inc. The names and logos for smtpapi-nodejs are trademarks of SendGrid, Inc.

License

The MIT License (MIT)