Blade directives being stripped out
liran-co opened this issue · comments
MJML will strip out any content outside of the tags. To work around this you can try wrapping your blade directives inside an <mj-raw></mj-raw>
tag, for example:
<mjml>
<mj-body>
<mj-raw>@if ($foo === 'bar')</mj-raw>
<mj-section>
<mj-column><mj-text>Foo</mj-text></mj-column>
</mj-section>
<mj-raw>@endif</mj-raw>
</mj-body>
</mjml>
Ah okay, that works! I wonder if there is a way to automatically wrap any blade directives with <mj-raw>
- thoughts?
I'm going to hold off on that for now I think, as it would introduce a lot of complexity in the plugin to parse out Blade directives, especially when having to ignore directives that are placed within specific nodes like <mj-text />
.