Skip to content

2. Quick Start

Johann Buscail edited this page Oct 16, 2021 · 2 revisions

After downloading the package, simply import the module:

import { mjml2HTMLParser } from "@wavychat/mjml-parser";

bitmoji

To convert your MJML template to HTML with variables, simply do:

const html = await mjml2HTMLParser({
    mjmlPath: __dirname + "/MY_MJML_FILE",
    template: {
        engine: "ejs", // can be ejs, handlebars, underscore 
        vars: {
            MY_VARIABLE: "MY_VALUE",
        }
    }
});
Clone this wiki locally