电子邮件标记操作的内容类型

Content-Type for Email Markup Actions

我一直在查看电子邮件 Actions(显然处于标准化过程中),并考虑在我的应用程序中实施这些。

但是,整个文档似乎缺少为包含此 json-ld 元数据的消息部分定义的 mime 类型。例如gpg签名标记为

Content-Type: application/pgp-signature; name="signature.asc"

这部分(例如:this content)需要包含在什么内容类型中?

您必须将其包含在电子邮件的 HTML (text/html) 中。

Google(即 Gmail 和 Gmail 收件箱)supports JSON-LD 和微数据:

  • JSON-LD 将包含在 script 元素中(使用 as data block)。

  • 微数据属性(如 itemscopeitemprop)将直接添加到(现有的)HTML 元素。

因此,如果您的电子邮件包含此 HTML

<html>
  <body>
    <p>Foobar</p>
  </body>
</html>

你可以像这样添加 JSON-LD

<html>
  <body>
    <script type="application/ld+json">
    {
      "@context": "http://schema.org",
      "@type": "Thing",
      "name": "Foobar"
    }
    </script>
    <p>Hello!</p>
  </body>
</html>

和这样的微数据

<html>
  <body itemscope itemtype="http://schema.org/Thing">
    <p itemprop="name">Foobar</p>
  </body>
</html>