https://github.com/chronotruck/mjml2html
Expose a simple API to convert MJML to HTML on the fly.
https://github.com/chronotruck/mjml2html
api docker email express mjml nodejs
Last synced: 2 months ago
JSON representation
Expose a simple API to convert MJML to HTML on the fly.
- Host: GitHub
- URL: https://github.com/chronotruck/mjml2html
- Owner: chronotruck
- License: mit
- Created: 2018-08-06T13:09:06.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-02-14T14:46:33.000Z (over 1 year ago)
- Last Synced: 2025-04-08T21:23:43.604Z (3 months ago)
- Topics: api, docker, email, express, mjml, nodejs
- Language: JavaScript
- Homepage: https://github.com/orgs/chronotruck/packages/container/package/mjml2html
- Size: 1.56 MB
- Stars: 12
- Watchers: 2
- Forks: 2
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# MJML2HTML




[](https://github.com/chronotruck/mjml2html/blob/master/LICENSE)> Simple API to convert MJML content to HTML on the fly.
## Requirements
- Git
- Docker
- Docker-compose## Getting started
To set-up the project, run the following command:
```bash
docker-compose up
```Once the Docker is running, you can use your API endpoint under `localhost:3001`.
## Usage
This project exposes a `POST` endpoint under `/`. To make it work, you must send a `text/plain` body with your MJML content.
When received, the server converts your MJML into an HTML string and returns the content as `text/html`.## Example
```bash
curl --header "Content-Type: text/plain" \
--request POST \
--data 'Hello!' \
http://localhost:3001/
```May return:
```html
Hello!
```## API
To use the API params, you can pass them as query parameters
`localhost:3001/?comments=false&minfiy=true`.| Param | Type | Default | Possible values |
|------------|------------|------------|------------
| comments | Boolean | false |
| minify | Boolean | false |
| beautify | Boolean | false |
| validation | String | strict | skip, soft, strict## License
This project is licensed under [MIT License](http://en.wikipedia.org/wiki/MIT_License)