This snippet serves as a starting point for your Markdown mails. You can save this in a file under the views, for example in mails/contact.blade.php
. Next, you can create a mail, choose Markdown as the body type and select this view.
You'll notice that we don't use indentation here, because this would break the Markdown parsing.
@component('mail::layout')
{{-- Header --}}
@slot('header')
@component('mail::header', ['url' => config('app.url')])
<img src="{{ asset('logo.png') }}" width="200">
@endcomponent
@endslot
{{-- Title --}}
# New message on website
{{-- Body with parameters --}}
**Name**\
{{ $parameters['name'] ?: '—' }}
**Email**\
{{ $parameters['email'] ?: '—' }}
**Message**\
{!! nl2br($parameters['message'] ?: '—') !!}
{{-- Button --}}
@component('mail::button', ['url' => page('home')->url(), 'color' => 'success'])
Visit Us
@endcomponent
{{-- Panel --}}
@component('mail::panel')
This is the panel content.
@endcomponent
{{-- Table --}}
@component('mail::table')
| Laravel | Table | Example |
| ------------- |:-------------:| --------:|
| Col 2 is | Centered | $10 |
| Col 3 is | Right-Aligned | $20 |
@endcomponent
{{-- Footer --}}
@slot('footer')
@component('mail::footer')
© {{ date('Y') }} {{ globals('general')->website_title }}. All rights reserved.
@endcomponent
@endslot
@endcomponent
Previous topic
← Fancybox
Next topic
Append to Google Spreadsheet →