Using Mailables Markdown Laravel

Just to make it short this is just to make mailables markdown template, which has been useful to me.

php artisan make:mail CreateOrder --markdown=mail.orders.created

File app.mail.createOrder

public function __construct($content)
$this->content = $content;

public function build()
return $this->from('[email protected]')

File - views.mail.orders.created


@component('mail::button', ['url' => $content['url']])

Thank you,

{{ config('') }}

File - app.Http.Controllers.any

use App\Mail\CreateOrder;
use Mail;

$content = [
'title'=> $args['booking_number'],
'body'=> 'Body',
'button' => 'Action Text',
'url' => url('anywhere')
$receiverAddress = 'name@domain';
Mail::to($receiverAddress)->send(new CreateOrder($content));

Subscribe to You Live What You Learn

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
[email protected]