@faire/mjml-react
Version:
React component library to generate the HTML emails on the fly
20 lines (19 loc) • 517 B
JavaScript
import mjml2html from "mjml";
import { renderToMjml } from "./renderToMjml";
export function render(email, options = {}) {
const defaults = {
keepComments: false,
beautify: false,
validationLevel: "strict",
minifyOptions: {
collapseWhitespace: true,
minifyCss: true,
removeComments: "safe",
removeEmptyAttributes: true,
},
};
return mjml2html(renderToMjml(email), {
...defaults,
...options,
});
}