1.1.6 • Published 16 days ago
jsrender-mjml v1.1.6
Installation
$ npm install -g jsrender-mjml
Usage
$ jsrender-mjml -h
Usage: jsrender-mjml [options]
Options:
-V, --version output the version number
-p, --port <n> port of server (default: 1410)
--hostname [value] port of server (default: 127.0.0.1)
-h, --help output usage information
Example request
POST request json parameters:
- mjml (required)- template in MJML notation with JSRender syntax
- jsonData (optional)- JSON data for render MJML template
- skipJSRender (optional) - flag for skipping JSRender processing part of pipeline
- secondPass (optional) - flag for 2-pass resolve of JSON data (rawData), nested variables will be replaced up to depth 2
$ curl localhost:1410 -d '{ "mjml": "<mjml><mj-body><mj-section><mj-column><mj-text>{{:greeting}}</mj-text></mj-column></mj-section></mj-body></mjml>","jsonData" : {"greeting": "Hello World{{:ivar}}", "ivar" : "!" }, "secondPass": true}'
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<title>
...