【发布时间】:2021-08-31 04:57:33
【问题描述】:
我试图在 laravel 电子邮件模板中包含图标但没有成功。我想在布局模板上的按钮、链接...中包含 .svg(或任何其他格式)图标。
这是我当前在“resources/views/vendor/mail/html/layout.blade.php”文件中的代码:
<!-- 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>
但收到的电子邮件中没有显示错误或图标。
感谢您的帮助。
【问题讨论】:
-
试试
-
我也不工作。我应该在我的问题中明确指出的重要事实: - 它是一个单页应用程序,安装在 Router Vue 结构上。即使我为图像安装了网络路由,我也只能得到一个下载链接,而不是显示 - 我使用降价来发送电子邮件。所以我没有可用于嵌入图像的 $message 变量。谢谢四位的建议!
标签: laravel image email icons markdown