I am currently trying to add a logo into my laravel email template. But everything I tried does not meet my requirements.
- The image should be visible in all email clients, without the user having to give permessions to download the image.
- The image should not be added as an attachment
These are the thing thats I have already tried:
<img src="https://my-url.com/img/logo-mail.png" />
In outlook clients, the logo does not show up since you have to verify the source and download the image
<img src="{{ public_path('img/logo-mail.png') }}" />
This works in Outlook, but Gmail is not showing the image
<img src="{{ $message->embed(public_path('img/logo-mail.png')) }}" />
In some clients this method adds the image as an attachment to the email. I can not use this since people can reply on this email, and our ERP system automatically creates a ticket and attaches the logo to it in every response. It is also not possible to detect the image and not add it in the ERP system, since the name of the image is randomly generated using the embed function.
<img src="data:image/png;base64,{{ base64_encode(file_get_contents(public_path('img/logo-mail.png'))) }}" />
I tried to add the image as a base64 string. This works in Outlook, but Gmail does not support base64 images.
I can’t seem to find an option to add this logo, while all email clients accept it without needing verification from the user and the logo is not added as an attachment.