gulp-mc-inliner
Gulp plugin for inlining CSS throught MailChimps Inliner API.
Usage
npm install gulp-mc-inliner --save-dev
Create mailchimp.json
file and add your MailChimp API key.
{
"KEY": "your key goes here"
}
Require both in your gulpfile.js
:
var inliner = require('gulp-mc-inliner');
var config = require('config/mailchimp');
gulp.task('inline', function() {
gulp.src('src/*.html')
.pipe(inliner(config.KEY))
.pipe(gulp.dest('email/template.html'));
});
API
inliner(key, strip)
key
Type: String
MailChimp API Key.
Create a API key from your MailChimp Account.
stripCSS
Type: boolean
Default: false
Boolean value indicating to the MailChimp API whether to strip CSS from the head tag.
This gulp plugin is a rewite of https://github.com/jayzawrotny/gulp-mc-inline-css with added option to specify whether or not to strip style tags from the head tag.
More features coming soon.