# mjml2html: Generate HTML Email Body with MJML

> mjml2html (Generate HTML Email Body with MJML) is a 1001fx API function in the group Data & JSON: POST https://api.1001fx.com/data/mjml2html, 2 credits per call. It works as a ready-made module in Make and n8n or as a plain HTTP call.

Generates a responsive HTML email body from an MJML template.

- Group: Data & JSON
- Endpoint: `POST https://api.1001fx.com/data/mjml2html`
- Authentication: header `X-API-KEY: YOURSECRETAPIKEY`
- Content type: application/json
- Credits: 2 credits per call
- Ready-made in: Make and n8n
- Docs: https://1001fx.com/functions/mjml2html

## Parameters

- `mjml` (string, required) – MJML: MJML Template. See https://mjml.io for further informations.
- `validationLevel` (enum, optional, one of `skip`, `strict`, `soft`, default `skip`) – Validation Level: MJML is rendered without going through validation. soft: MJML is going through validation and is rendered, even if it has errors. strict: MJML is going through validation and is not rendered if it has any error. Defaults to skip.

## Use cases

- Build responsive HTML emails from an MJML template and send them from your workflow
- Fill an MJML newsletter template with data and render it before sending
- Keep email layouts in MJML and generate the HTML in n8n

## Example: MJML2HTML

```bash
curl -X POST 'https://api.1001fx.com/data/mjml2html' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -H 'Content-Type: application/json' \
  -d '{"mjml":"<mjml><mj-body><mj-section><mj-column><mj-text>Hello World!</mj-text></mj-column></mj-section></mj-body></mjml>","validationLevel":"skip"}'
```

## FAQ

**What is MJML?**

A markup language for responsive emails. MJML templates are shorter than hand-written email HTML and render well in common email clients.

**What happens with invalid MJML?**

That depends on validationLevel: skip (default) renders without validation, soft validates and renders anyway, strict does not render if there is any error.
