# \<mj-include /\> not working in a MJML template in Mautic v5

**URL:** <https://forum.mautic.org/t/mj-include-not-working-in-a-mjml-template-in-mautic-v5/34775>\
**Category:** Product Support\
**Created:** [January 17, 2025, 12:35pm UTC](https://forum.mautic.org/t/mj-include-not-working-in-a-mjml-template-in-mautic-v5/34775 "2025-01-17T12:35:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexnitsche](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/alexnitsche/32/12272_2.png) [@alexnitsche](https://forum.mautic.org/u/alexnitsche)\
**Post date:** [January 17, 2025, 12:35pm UTC](https://forum.mautic.org/t/mj-include-not-working-in-a-mjml-template-in-mautic-v5/34775/1 "2025-01-17T12:35:35Z")

</div>

**Your software**  
My Mautic version is: 5.2.1  
My PHP version is: 8.2.20  
My Database type and version is: MariaDB 10.5.18

**Your problem**  
My problem is, i cannot seem to load CSS from an external file in my MJML template via . It is not considered neither in the GrapesJS builder nor in the rendered email. I tried e.g. “” where the mail.css was placed in /css/mail.css and the MJML template file in /html/email.mjml.twig.

I tried to fix the problem by inserting into the mj-head or the mj-body section, but neither worked.

---

<div class="post-metadata">

**Author:** ![ricfreire](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ricfreire/32/14973_2.png) [@ricfreire](https://forum.mautic.org/u/ricfreire)\
**Post date:** [January 26, 2025, 11:45pm UTC](https://forum.mautic.org/t/mj-include-not-working-in-a-mjml-template-in-mautic-v5/34775/2 "2025-01-26T23:45:31Z")

</div>

Hello @alexnitsche

You can insert an external CSS file in this way:

```auto
<mjml>
  <mj-raw position="file-start">
    <link rel="stylesheet" type="text/css" href="{{ getAssetUrl('themes/'~template~'/css/style.css', null, null, true ) }}">
  </mj-raw>

```

This way it worked for me. Hope I helped you out.  
Best regards,  
Ricardo

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/1X/43c63600fe51440378769136903f1fa2a9a34102.png) [@system](https://forum.mautic.org/u/system)\
**Post date:** [April 2, 2025, 11:07am UTC](https://forum.mautic.org/t/mj-include-not-working-in-a-mjml-template-in-mautic-v5/34775/3 "2025-04-02T11:07:12Z")

</div>

Closed on April 2, 2025, 11:07am UTC

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.
