Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inliner #29

Closed
teslaji opened this issue Sep 19, 2015 · 2 comments
Closed

inliner #29

teslaji opened this issue Sep 19, 2015 · 2 comments

Comments

@teslaji
Copy link

teslaji commented Sep 19, 2015

can you tell me which inliner processor you used to generate html-inlined.
I have some changes in body and your inlined version is not much readable.

@leemunroe
Copy link
Owner

I used Zurb for this. Although on production projects I'll often use Premailer or Juice.

@jonscottclark
Copy link

+1 for Juice!

Like Premailer and Zurb Ink, Juice has a web version that also allows you to set a lot of different options: http://automattic.github.io/juice/

Here's how I use Juice in a gulp workflow:

var mapStream = require('map-stream');
var juice = require('juice');

gulp.task('inline-email', function() {
  // Juice options
  var options = {
    preserveMediaQueries: true,
    preserveImportant: true,
    webResources: {
      images: false
    }
  };

  return gulp.src('src/email*.html')
    .pipe(mapStream(function(file, done) => {
      var basename = path.basename(file.path);
      var target = path.join('dist', basename);
      juice.juiceFile(file.path, options, function(err, html) => {
        fs.writeFileSync(target, '');
        fs.appendFileSync(target, html);
      });
      done();
    }));
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants