Joan T
Joan T

Reputation: 47

Icons on laravel email templates

I am trying to include Icons in laravel email templates without success. I would like to include .svg (or any other format) icons in buttons, links ... on the layout template.

This is my current code in "resources/views/vendor/mail/html/layout.blade.php" file:

<!-- Body content -->
<tr>
<td class="content-cell">
{{ Illuminate\Mail\Markdown::parse($slot) }}

<!-- First try. No success -->
<img src='/resources/svg/camera.svg'></img>

<!-- Second try. No success -->
<img src='/public/images/camera.svg'></img>

<!-- Third try. No success -->
<svg fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z"/>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 13a3 3 0 11-6 0 3 3 0 016 0z"/>
</svg>

But no error nor icon is shown in received email.

Thank you for your help.

Upvotes: 0

Views: 1389

Answers (2)

scorpions78
scorpions78

Reputation: 558

If you´re working in localhost this icons don´t show it

Upvotes: 0

albus_severus
albus_severus

Reputation: 3702

It happens because you save your image on locally. Local image doesn't show on mail. please check with a image which is upload on server or any google image link

Upvotes: 3

Related Questions