GitLab 例如,当您将字母悬停在 gmail 中时,GitLab 有这个奇特的“查看合并请求”按钮和“取消订阅”按钮,我想知道如何创建类似的按钮
我想为我的电子邮件添加类似的按钮,不知道要搜索什么或如何创建这样的东西
这些称为 Gmail 操作。您可以在此处查看 Google 的文档:https://developers.google.com/gmail/markup/actions/actions-overview
它基本上是一个 JSON-LD 脚本元素,您可以将其添加到 HTML 电子邮件的
<head>
中。例如:
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"url": "https://www.example.com",
"name": "View Merge request"
},
"description": "Lorem ipsum dolor sit amet"
}
</script>