如何使用 pug 和 img 标签在电子邮件模板中包含图像?

发布于 2025-01-15 09:49:37 字数 874 浏览 3 评论 0原文

每当电子邮件发送给用户时,都不会加载图像,并且会显示替代文本。这是每当我在浏览器中打开电子邮件时检查器中出现的 img 标签。

<img src="https://ci6.googleusercontent.com/proxy/Pm5tpNLIinvz0p0dF6dbHpM750__JhW0ZV1huQqVFnM-34fg8W7Gc67CBT0WUZWWBQ-gbCw=s0-d-e1-ft#http://static/images/DJiotitle.png" alt="DataJoint Databasee Setup" width="450" style="display:block" class="CToWUd" jslog="138226; u014N:xr6bB; 53:W2ZhbHNlXQ..">

这里是我的文件目录

这是代码库中包含 img 标签的代码行,

img(src='static/images/DJiotitle.png', alt='DataJoint Databasee Setup', width='450', style='display: block;')

我认为这与发送电子邮件并让浏览器在图像到达时找到图像有关。每当使用哈巴狗模板发送电子邮件时,我都尝试过研究 img 标签问题,但我没有找到任何可以帮助我解决这个问题的东西。我也尝试过使用不同的路径,例如 /static、static/,但没有这样的运气。

Whenever the email is sent to the user, the image isn't loaded and the alt text appears. This is the img tag that appears in the inspector whenever i open the email in the browser.

<img src="https://ci6.googleusercontent.com/proxy/Pm5tpNLIinvz0p0dF6dbHpM750__JhW0ZV1huQqVFnM-34fg8W7Gc67CBT0WUZWWBQ-gbCw=s0-d-e1-ft#http://static/images/DJiotitle.png" alt="DataJoint Databasee Setup" width="450" style="display:block" class="CToWUd" jslog="138226; u014N:xr6bB; 53:W2ZhbHNlXQ..">

Here is my file directory

Here is the line of code within the codebase that contains the img tag

img(src='static/images/DJiotitle.png', alt='DataJoint Databasee Setup', width='450', style='display: block;')

I'm thinking that this has to do with sending the email and having the browser find the image whenever it arrives. I've tried researching img tag issues whenever sending emails using templates with pug and i haven't found anything that could help me with this. I've also tried using different paths such as /static, static/, but no such luck.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

記憶穿過時間隧道 2025-01-22 09:49:37

我发现我需要使用源中公开可用的 url。

I found that I need to use the url that is publicly available within the source.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文