What are Transformers?

Transformers in Maizzle are functions that basically take a string of HTML, do something with it, and then return it for further processing.

They run after your Template has been compiled and allow you to manipulate the HTML in various ways, like prepending a base URL to all <img> tags or preventing widow words.

Some of the Transformers help you automate tedious tasks that are required when developing HTML emails, like inlining CSS, automatically adding attributes for better accessibility, or generating plaintext versions of your emails.

Transformers list

Most Transformers are enabled by default:

However, some are opt-in and need to be explicitly enabled in your config.js:

Disabling

You may disable all Transformers by setting useTransformers to false:

config.js
export default {
useTransformers: false,
}

Execution order

Transformers in Maizzle need to run in a specific order, see it on the build process page.

API

Maizzle Transformers can also be used programmatically in your application. You can inline some CSS or minify HTML even without using Maizzle to build your emails.

See the documentation of each Transformer for usage examples.

Copyright © 2024 Maizzle SRLBrand policy
Edit this page on GitHub