在看到一些将自定义操作添加到收件箱中的gmail主题行的示例之后,我发现了this文章,其中详细介绍了如何构造按钮。查看Jira电子邮件,您可以看到它的作用:
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"description": "View Issue",
"potentialAction": {
"@type": "ViewAction",
"target": "https://mysite.atlassian.net/browse/B-1111?inbox=true&",
"name": "View Issue"
},
"publisher": {
"@type": "Organization",
"name": "Atlassian",
"url": "https://www.atlassian.com"
}
}
</script>
我自己尝试执行此操作,似乎遇到了问题。我正在传输此html内容:
<html lang="en">
<head>
<title>Hello World</title>
</head>
<body>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"description": "Click Me",
"potentialAction": {
"@type": "ViewAction",
"target": "https://www.youtube.com/watch?v=wZZ7oFKsKzY",
"name": "Click Me"
},
"publisher": {
"@type": "Organization",
"name": "Bede Gaming",
"url": "https://www.bedegaming.com"
}
}
</script>
<p>Hello World</p>
</body>
</html>
,可以看到它正在接收的电子邮件源中传输:
该消息正确呈现为HTML,但由于某些原因自定义按钮未出现:
还有其他事情要做才能使它出现吗?