markdown mails are sent as html, and the markdown version is sent as text.
So, it means you only need one view file.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Does Laravel convert the html version of the email to text and send that? That's what I want to happen, I don't want to define a text template for it as well.
I thought it does it by default but trying mailsender and Laravel and trying to send an email I got an error:
MailerSend \ Exceptions \ MailerSendAssertException
One of template_id or text must be supplied
Tracking it down I found out in vendor/mailersend/laravel-driver/src/MailerSendTransport.php
dd($message->getTextBody());
returns null, so that made my understand I needed to define text as well to get rid of the error:
public function content(): Content
{
return new Content(
view: "mail.example",
text: "mail.example"
);
}
But I don't want that, I mean I'm fine if I can just give it the same html template and it converts it but not if it doesn't, so what's the best way to handle this?
markdown mails are sent as html, and the markdown version is sent as text.
So, it means you only need one view file.
Please or to participate in this conversation.