https://github.com/hyzyla/jinja2_mjml
Jinja2 integration with MJML
https://github.com/hyzyla/jinja2_mjml
Last synced: 27 days ago
JSON representation
Jinja2 integration with MJML
- Host: GitHub
- URL: https://github.com/hyzyla/jinja2_mjml
- Owner: hyzyla
- License: mit
- Created: 2023-01-31T18:43:37.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-31T18:53:45.000Z (over 2 years ago)
- Last Synced: 2025-09-23T03:56:29.470Z (about 1 month ago)
- Language: Python
- Size: 10.7 KB
- Stars: 8
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Jinja2 MJML
Micro-package that integrates [MJML](https://mjml.io/)
with [Jinja2](https://jinja.palletsprojects.com/en/2.11.x/).
Under the hood it uses [mjml_python](https://pypi.org/project/mjml-python/)
package, that is a wrapper around [rust port](https://github.com/jolimail/mrml-core)
of MJML.
## Example
```python
from jinja2_mjml import Environment
# MJMLEnvironment it's thin wrapper around jinja2.Environment,
# so you can use all the features of Jinja2 package.
environment = Environment()
template = environment.from_string('''
Hello {{ name }}!
''')
# Render MJML template to HTML
print(template.render(name='MJML'))
```