Minify Email Code

Use the minify option to trim down the HTML size of your production emails.

Minified email code weighs less in KB, resulting in faster sendouts, faster opens, and bandwidth savings on limited mobile data plans. Every little bit helps 🙂

Additionally, it reduces the risk of Gmail clipping.

Usage

config.js
module.exports = {
  minify: true,
}

Customization

You may configure the underlying html-crush library:

config.js
module.exports = {
  minify: {
    lineLengthLimit: 500,
    removeIndentations: true,
    breakToTheLeftOf: [],
  }
}

Checkout the full list of html-crush options.

API

app.js
const {minify} = require('@maizzle/framework')
const options = {/* html-crush options */}

const html = await minify('html string', options)

Copyright © 2022 Maizzle Edit this page on GitHub