Metadata-Version: 2.4
Name: django-mjml-template
Version: 1.0.0
Summary: Simple and fast MJML rendering for Django templates.
Keywords: django,mjml,template
Author-email: Thomas Edvalson <machin3@gmail.com>
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Classifier: Framework :: Django
Classifier: Framework :: Django :: 1.11
Classifier: Framework :: Django :: 2.2
Classifier: Framework :: Django :: 3.2
Classifier: Framework :: Django :: 4.0
Classifier: Framework :: Django :: 4.1
Classifier: Framework :: Django :: 4.2
Classifier: Framework :: Django :: 5.0
Classifier: Framework :: Django :: 5.1
Classifier: Framework :: Django :: 5.2
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Internet :: WWW/HTTP
License-File: LICENSE
Requires-Dist: mjml-python>=1.3.5
Requires-Dist: django>=1.11
Project-URL: Homepage, https://github.com/Cruel/django-mjml-template
Project-URL: Issues, https://github.com/Cruel/django-mjml-template/issues/

[![CI](https://github.com/Cruel/django-mjml-template/actions/workflows/ci.yml/badge.svg)](https://github.com/Cruel/django-mjml-template/actions/workflows/ci.yml) [![pypi](https://img.shields.io/pypi/v/django-mjml-template.svg)](https://pypi.org/project/django-mjml-template/)

# Django MJML Template

Use MJML in your Django templates. A very small and fast implementation.

## About

This
package leverages [MRML](https://github.com/jdrouet/mrml), a Rust implementation
of [MJML](https://github.com/mjmlio/mjml) using bindings provided by [mjml-python](https://github.com/mgd020/mjml-python).

If you want to run `MJML` itself as a separate HTTP server endpoint for conversion, use [django-mjml](https://github.com/liminspace/django-mjml) instead. It uses the same `mjml` template tag.

## What is MJML?

From the [documentation](https://documentation.mjml.io/) of the project:

> MJML is a markup language designed to reduce the pain of coding a responsive
> email. Its semantic syntax makes it easy and straightforward and its rich
> standard components library speeds up your development time and lightens your
> email codebase. MJML’s open-source engine generates high quality responsive
> HTML compliant with best practices.

## Requirements

- Python >= 3.7
- Django >= 1.11

## Installation

To install the package, run the following command:

```bash
pip install django-mjml-template
```

Then update your `settings.py`:

```python
INSTALLED_APPS = (
    ...
    'django_mjml_template',
)
```

## Usage

Load `mjml` in your django template and use `mjml` tag that will compile MJML to HTML:

```html
{% load mjml %}

{% mjml %}
  <mjml>
    <mj-body>
      <mj-section>
        <mj-column>
          <mj-text>Hello {{ user_name }}!</mj-text>
        </mj-column>
      </mj-section>
    </mj-body>
  </mjml>
{% endmjml %}
```

## Contributions

Contributions, bug reports, and suggestions are welcome! Feel free to open an
issue or submit a pull request.

