Replies: 1 comment
-
Came here asking the same question. Not sure if this is the intended way, but I found that you need to run the MJML through the Blade renderer first, and then through this package: use Illuminate\Support\Facades\Blade;
use Spatie\Mjml\Mjml;
$mjml_template = file_get_contents('email/template.mjml');
$processed_mjml = Blade::render($mjml_template, [
'header' => 'Here is the header',
'body' => 'And here is the body',
]);
$html = Mjml::new()->toHtml($processed_mjml); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Sending an email with spatie/mjml-php works for me. I can't figure out how to include conditionals though.
I tried with and without the handlbars {{@if (...)}}...{{@endif}}
What is the correct way to code this?
Beta Was this translation helpful? Give feedback.
All reactions