laravel-mjml
laravel-mjml copied to clipboard
Undefined variable $abc
When I pass a variable to the view content I get this issue
public function content()
{
return new Content(
view: $this->mjml('test')->buildMjmlView()['html'],
with: [
'abc' => 'Dummy Sentence'
]
);
}
I have the same problem, any ideas?
Maybe it's been solved but for future notice I use it like this
public function content()
{
return new Content(
view: $this->mjml('emails.reservation',
[
'name' => 'John Doe',
'price' => '1000'
])
->buildMjmlView()['html'],
);
}
and the view
<mjml>
<mj-body >
<mj-column>
<mj-text>{{$name}}</mj-text>
<mj-text>{{$price}}</mj-text>
</mj-column>
</mj-body>
</mjml>