This is default email generated and sent by laravel using smtp , and i want to change this default template like adding some pictures,url... how can i do that? thanks
Run php artisan vendor:publish
and navigate to resources/views/vendor/notifications
then now you have two files, edit them.
Here i am only showing how can you change the default Laravel logo from your mail template
first step is to publish our Mail components inside our resource folder so that we can change the default configuration .
run the following command .
php artisan vendor:publish --tag=laravel-mail
Now this command will create a vendor folder inside your app/resources/views directory .
now you can provide your image path in the mail template to use your custom image on Mail as shown in the following code
@component('mail::layout')
{{-- Header --}}
@slot('header')
@component('mail::header', ['url' => config('app.url')])
{{-- {{ config('app.name') }} --}}
<img src="{{asset('storage/logo/logo.jpg')}}" style="height: 75px;width: 75px;">
@endcomponent
@endslot
{{-- Body --}}
{{ $slot }}
{{-- Subcopy --}}
@isset($subcopy)
@slot('subcopy')
@component('mail::subcopy')
{{ $subcopy }}
@endcomponent
@endslot
@endisset
{{-- Footer --}}
@slot('footer')
@component('mail::footer')
© {{ date('Y') }} {{ config('app.name') }}. @lang('All rights reserved.')
@endcomponent
@endslot
@endcomponent
For more information you can visit here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With