Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to load included template #122

Open
amin-wan-kenobi opened this issue Jan 4, 2024 · 1 comment
Open

unable to load included template #122

amin-wan-kenobi opened this issue Jan 4, 2024 · 1 comment

Comments

@amin-wan-kenobi
Copy link

amin-wan-kenobi commented Jan 4, 2024

In my mjml template I have mj-include but when I run to_html function, I get unable to load included template error.
Here's an example of my template

<mjml>
  <mj-head>
    <mj-include path="./partials/head.mjml" />
  </mj-head>
  <mj-body>
    <mj-include path="./partials/header.mjml" />   
    <mj-wrapper>
      <mj-section>
        <mj-column>
          <mj-text font-size="16px">
           Dear {{ username }},
          </mj-text>
          <mj-text font-size="16px">
           We have received your request
          </mj-text>
        </mj-column>
      </mj-section>
    </mj-wrapper>
    <mj-include path="./partials/simple_footer.mjml" />
  </mj-body>
</mjml>

Any idea how to solve this? I tried replacing the path with the absolute path of the mj-include file but the error persosts.

@amin-wan-kenobi
Copy link
Author

For now, I read the partial template and replaced the whole mj-include with it. But I was wondering if there was a better way to solve this matter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant