Skip to content

Support mj-include #37

Open
Open

Description

@tulzke

Hi, while integrating gomjml into a mail templating workflow, I noticed that mj-include does not seem to be supported.

I could not find any mention of mj-include in the documentation, and I also could not find support for it in the source code.

This is a blocker for a common MJML use case: splitting large templates into reusable partials such as:

  • shared header
  • shared footer
  • repeated content blocks
  • different email variants built from the same layout

For example, a template like this:

<mjml>
  <mj-body>
    <mj-include path="header.mjml" />
    <mj-section>
      <mj-column>
        <mj-text>Hello</mj-text>
      </mj-column>
    </mj-section>
    <mj-include path="footer.mjml" />
  </mj-body>
</mjml>

Activity

  1. pierre-b commented on Mar 25, 2026

    @pierre-b
    Contributor

    If somehow this feature is implemented, I would prefer it to be disabled by default. Including external files is always a security risk during parsing, with malicious code injection etc...

  2. danielloader commented on Sep 30, 2026

    @danielloader

    Yeah it's worth noting MJML5 seems to be trying to soft deprecate it with the opt in model too, so I doubt it'll make it to MJML6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions