did you clean the view cache?
php artisan view:clear
Also any tab or space at the start of the line may cause that in view file.
Hi
I'm having some issues with markdown mail components not being rendered. When I test my email it just shows the raw message component code.
My Laravel version is 10 and the components that I'm using at the moment are the ones from Laravel, published with
php artisan vendor:publish --tag=laravel-mail
I have the following code:
Controller:
public function testMails(Request $request) {
$user = Auth::user();
$order = $user->latestOrder;
return new InvoicePaid($order);
}
Mail content function:
public function content(): Content
{
return new Content(
markdown: 'emails.invoice-paid',
with: [
'url' => 'test',
],
);
}
Mail view:
<x-mail::message>
# Invoice paid
Your invoice has been paid!
<x-mail::button :url="$url">
View invoice
</x-mail::button>
Thanks,<br>
{{ config('app.name') }}
</x-mail::message>
The result that I get in the browser is the following:
<:message style="box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; position: relative;"> # Order Shipped Your order has been shipped! <:button :url="$url" style="box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; position: relative;"> View Order Thanks,
{{ config('app.name') }}
So it seems to be doing something, but by far not the desired result. FYI, I'm using Visual Studio Code and made sure auto formatting is off to avoid indentation issues in the markdown files.
Anyone that has an idea what might be going wrong here?
Thanks!
Please or to participate in this conversation.