Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

elo's avatar
Level 3

Displaying logo in email notifications

Hi guys, I want to display a logo in email notifications, so I did the following

First, copied the components by running the following statement

php artisan vendor:publish --tag=laravel-mail

Then in the resources/views/vendor/mail/html/message.blade.php I modified this header slot like this

@slot('header')
    @component('mail::header', ['url' => 'website address'])
        <img src="{{asset('logo.png')}}" alt="{{config('app.name')}}">
    @endcomponent
@endslot

The logo.png file is just sitting inside the public folder but when an email is sent, the logo doesn't show. An empty box is displayed instead like this enter image description here

What possibly could I be doing wrong?

0 likes
1 reply
janosk's avatar

Hi! There can be multiple reasons why it is not showing up. You can include various content in an email even potentionally harmful. Of course that is not your intention, yet mail clients usually don't load external sources without permission. The asset you provide is an external source (linked from your site) if it is inside an email which is sent to people inboxes.

Haven't tried it yet, but perhaps take a look at this, seems like a good practice for embedded images, like a logo.

https://laravel.com/docs/6.0/mail#inline-attachments

Hope it helps!

Please or to participate in this conversation.