Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Ligonsker's avatar

Can I write plain HTML in a markdown blade file?

I created a Markdown Mailable using php artisan make:mail OrderShipped --markdown=emails.orders.shipped

In the blade file itself, shipped.blade.php can I delete all the content and write plain HTML instead of using the components method?

0 likes
3 replies
LaryAI's avatar
Level 58

Yes, you can write plain HTML in a Markdown blade file. Simply delete the default content and write your HTML code as you normally would.

Here's an example of a Markdown blade file with plain HTML:

@component('mail::message')
# Hello!

<p>This is a plain HTML paragraph.</p>

<ul>
    <li>List item 1</li>
    <li>List item 2</li>
    <li>List item 3</li>
</ul>

@endcomponent

Note that you can still use Markdown syntax within the HTML code if you prefer.

Snapey's avatar
Snapey
Best Answer
Level 122

bear in mind that you cannot just write ANY html

Email clients are stuck in the days when layout was done with tables - you can't go using flex box for instance

The components that come with Laravel have been written with these limitations in mind

1 like
Ligonsker's avatar

@Snapey Haha I wish I saw your message earlier, I made a great flex layout.. then in the email I got plain text šŸ˜‚šŸ˜­.

So I should stick to tables I assume, just like Laravel's components are. I hope I remember how to style them lol

Please or to participate in this conversation.