kevnk / gulp-sendgrid

Gulp plugin for creating SendGrid templates + versions. Works great with Foundation Emails.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gulp-sendgrid npm version

Create SendGrid templates and versions. Works great with Foundation Emails

Install

$ npm install gulp-sendgrid

Usage

var gulp = require('gulp');
var sendgrid = require('gulp-sendgrid');

var config = {
    apiKey: "YOUR-API-KEY"
}

gulp.task('default', function () {
	return gulp.src(['src/**/*.html','!src/index.html'])
		.pipe(sendgrid(config))
		.pipe(gulp.dest('dist'));
});

API

sendgrid(config)

config

config.apiKey

Type: String
Default: ''
Required: yes

SendGrid API Key. It should be about 69 characters long. It is NOT your "API Key ID". SendGrid only shows the full API Key once, so if you don't know it, you'll need to create another one.

config.versionPrefix

Type: String
Default: ''
Required: no

If you want to prefix your versions coming from this plugin. The final version name would end up version-prefix-file-name

Troubleshooting

  1. Make sure you've included your SendGrid API Key — it should be about 69 characters long. It is NOT your "API Key ID" (you'll need to create a new "General" API token if all you see is "API Key ID").
  2. Make sure you've set the API Key to have "Full Access" to "Transactional Templates"
  3. Try white-listing your IP from the SendGrid admin

License

MIT © Kevin Kirchner

About

Gulp plugin for creating SendGrid templates + versions. Works great with Foundation Emails.


Languages

Language:JavaScript 100.0%