如何使用 pug 和 img 标签在电子邮件模板中包含图像?
每当电子邮件发送给用户时,都不会加载图像,并且会显示替代文本。这是每当我在浏览器中打开电子邮件时检查器中出现的 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 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现我需要使用源中公开可用的 url。
I found that I need to use the url that is publicly available within the source.