Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change default laravel email template theme sent to gmail or hotmail

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

image

like image 655
Ilham Guezzoula Avatar asked Apr 16 '17 19:04

Ilham Guezzoula


2 Answers

Run php artisan vendor:publish and navigate to resources/views/vendor/notifications then now you have two files, edit them.

like image 180
Cristian Cosenza Avatar answered Sep 21 '22 01:09

Cristian Cosenza


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

like image 42
kishan maharana Avatar answered Sep 21 '22 01:09

kishan maharana