liminspace / django-mjml

The simplest way to use MJML in Django templates.
MIT License
263 stars 32 forks source link

mj-include doesn't work #85

Closed glowingkitty closed 5 years ago

glowingkitty commented 5 years ago

Importing other mj files like in this example doesn't work via the django implementation. Do we need to change the path?

<mjml>
  <mj-head>
    <mj-attributes>
      <mj-preview>Please confirm your e-mail</mj-preview>
      <mj-include path="components/css.mjml" />
    </mj-attributes>
  </mj-head>
...
      <mj-column>

        <mj-include path="components/header.mjml" />

    ...
      <mj-include path="components/footer_social_media_links.mjml" />
    </mj-section>
    <mj-include path="components/footer_bottom.mjml" />

  </mj-body>
</mjml>
liminspace commented 5 years ago

You can't use mj-include as the render-server can be without any files (e.g. templates) of your project. So, just use django template include tag: {% include 'components/footer_bottom.mjml' %}.