Skip to content

hyzyla/jinja2_mjml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jinja2 MJML

Micro-package that integrates MJML with Jinja2.

Under the hood it uses mjml_python package, that is a wrapper around rust port of MJML.

Example

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('''
    <mjml>
      <mj-body>
        <mj-section>
          <mj-column>
            <mj-text>Hello {{ name }}!</mj-text>
          </mj-column>
        </mj-section>
      </mj-body>
    </mjml>
''')

# Render MJML template to HTML
print(template.render(name='MJML'))

About

Jinja2 integration with MJML

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages