Minify Email Code

Use the minify options to trim down the HTML size of your production emails. Minified email code weighs less in KB, resulting in faster sendouts and faster opens.

Additionally, it reduces the risk of Gmail clipping.


Maizzle uses html-minifier and exposes its options to your config. For example, let's define after how many characters minified code should break:

// config.js
module.exports = {
  minify: {
    maxLineLength: 500,
    // ...
  },
  // ...
}

Checkout the full list of html-minifier options ↗

removeEmptyAttributes

Removes all attributes with whitespace-only values:

module.exports = {
  minify: {
    removeEmptyAttributes: true,
  },
}

After CSS inlining and cleanup take place, it can happen that you end up with empty style="" attributes. This option can help you get rid of them.