简体   繁体   English

在 Sendgrid 动态模板中创建脚本标签

[英]Create script tags in Sendgrid Dynamic template

What I need is I want to fetch an API using a button.我需要的是我想使用按钮获取 API。 I have created html template in sendgrid dynamic template from preview its working perfectly.我已经在 sendgrid 动态模板中创建了 html 模板,预览它的工作完美。 But email the invisible.但是 email 是隐形的。

After that I have removed button and check with anchor tag same issue not working.之后,我删除了按钮并检查锚标签相同的问题不起作用。

代码示例

email body its appearing but cannot click or do anything email 主体出现但无法单击或执行任何操作

无法点击

But in the html template all are working fine and APIs are fetching perfectly但在 html 模板中,一切正常,API 完美获取

在此处输入图像描述

I regret to inform you that email clients block JavaScript from executing, so this cannot work.很遗憾地通知您,email 客户端阻止 JavaScript 执行,所以这不起作用。

You should make your unsubscribe button link to a page on your site in which your user can unsubscribe.您应该将退订按钮链接到您网站上的用户可以退订的页面。

There are some circumstances in which you can run (sort of) JavaScript in some email clients.在某些情况下,您可以在某些 email 客户端中运行(某种程度上)JavaScript。 There is a framework called AMP4Email which allows you to use web components with extra behaviour within an email, you can read an introduction to sending AMP emails here .有一个名为 AMP4Email 的框架,它允许您在 email 中使用具有额外行为的 web 组件,您可以在此处阅读发送 AMP 电子邮件的介绍

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM