Google(收件箱、gmail、现在)无法识别 EventReservation

Google (inbox, gmail, now) doesn't recognize EventReservation

我正在将 EventReservation JSON-LD 添加到电子邮件中(使用 Chrome 的 gmail API 从我 发送给我 延期)。

它已成功发送到我的收件箱,但google 未将此识别为事件。这是来自已发送电子邮件的电子邮件 body 转储(HTML 部分已通过 google 结构化数据测试工具和 yandex 结构化数据验证器成功验证,实际上 json 是 copy-pasted 来自在我的收件箱中解析的真实事件,因此脚本应该是好的):

Received: from 236444161893
    named unknown
    by gmailapi.google.com
    with HTTPREST;
    Sat, 26 Mar 2016 07:34:52 -0400
From: XXXXXXX@gmail.com
To: XXXXXXX@gmail.com
Subject: Lets Celebrate !
Content-Type: text/html; charset="utf-8"
Date: Sat, 26 Mar 2016 07:34:52 -0400
Message-Id: <CAEY7X7rQZFQTmYqyH-UEMt5KR3bwbC5D-KhT3Rv8vKixVrGkFA@mail.gmail.com>


<html>
    <head>
        <title>Sample Title</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    </head>
    <body>
        <script type="application/ld+json">
{
    "@context": "http://schema.org",
    "@type": "EventReservation",
    "reservationNumber": "123123123",
    "underName": {
        "@type": "Person",
        "name": "John Smith"
    },
    "reservationStatus": "http://schema.org/Confirmed",
    "reservationFor": {
        "@type": "Event",
        "name": "ProductCamp Helsinki 2016",
        "startDate": "2016-04-09T10:00:00+03:00",
        "endDate": "2016-04-09T16:00:00+03:00",
        "location": {
            "@type": "Place",
            "name": "OP Headquarters",
            "address": {
                "@type": "PostalAddress",
                "streetAddress": "Teollisuuskatu 1E00510 Helsinki",
                "addressLocality": "Helsinki",
                "addressRegion": "",
                "postalCode": "00510",
                "addressCountry": "FI"
            }
        }
    }
}
        </script>
        <b>I did it!</b>
    </body>
</html>

EventReservation Email in my Inbox

有什么问题吗?

UPDATE:当我通过 script.google.com (MailApp.sendEmail) 发送时,此 HTML 有效并由收件箱解析,但没有如果它是使用 gmail API (POST https://www.googleapis.com/gmail/v1/users/me/messages/send) 从 Chrome 扩展发送的,则工作。所以看起来电子邮件 headers 有问题。例如。 "correct" 从 script.google.com 发送的电子邮件包含 DKIM-Signature 等:

Delivered-To: XXXXXXX@gmail.com
Received: by 10.31.52.16 with SMTP id b16csp631299vka;
        Sat, 26 Mar 2016 05:40:04 -0700 (PDT)
X-Received: by 10.31.58.139 with SMTP id h133mr9599567vka.158.1458996004694;
        Sat, 26 Mar 2016 05:40:04 -0700 (PDT)
Return-Path: <3JIP2VgkJCcEiluklyzwinthps.jvtiluklyzwinthps.jvt@maestro.bounces.google.com>
Received: from mail-vk0-x245.google.com (mail-vk0-x245.google.com. [2607:f8b0:400c:c05::245])
        by mx.google.com with ESMTPS id g188si4468255vkf.94.2016.03.26.05.40.04
        for <XXXXXXX@gmail.com>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Sat, 26 Mar 2016 05:40:04 -0700 (PDT)
Received-SPF: pass (google.com: domain of 3JIP2VgkJCcEiluklyzwinthps.jvtiluklyzwinthps.jvt@maestro.bounces.google.com designates 2607:f8b0:400c:c05::245 as permitted sender) client-ip=2607:f8b0:400c:c05::245;
Authentication-Results: mx.google.com;
       dkim=pass header.i=@gmail.com;
       spf=pass (google.com: domain of 3JIP2VgkJCcEiluklyzwinthps.jvtiluklyzwinthps.jvt@maestro.bounces.google.com designates 2607:f8b0:400c:c05::245 as permitted sender) smtp.mailfrom=3JIP2VgkJCcEiluklyzwinthps.jvtiluklyzwinthps.jvt@maestro.bounces.google.com;
       dmarc=pass (p=NONE dis=NONE) header.from=gmail.com
Received: by mail-vk0-x245.google.com with SMTP id e6so159765935vkh.0
        for <XXXXXXX@gmail.com>; Sat, 26 Mar 2016 05:40:04 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:message-id:date:subject:from:to;
        bh=AcafBmWjtt8pobLyfk/O93P08+xv/A6AO4gP7r6A0pI=;
        b=ZXfhpJnohG6skmBxr4JFYf/743Sy7ckO7PnyUBXytwPNwh3GoULK+LJAyXloqt4hBs
         7aoKDtuFsr4o2Q2Q+fexqw3qY8QheK/FG7Mr2lVAfVMDg56tumRIp27B4XmaNyL96S3k
         i35hR5B5trQKU/qFENnXCQc5LjFdDLUADzbrs6VMHLZW8I/73Yq7+/JDkHeMmIZMAboz
         KN8qyWaFZSJvMGg3NTkurkpBE5oJ6KxCN6cjZKLoUFfbPaqa9cdc0c7w4+fNFK0DzjPT
         ESsDEpxS9K/1ZL70xYpUmrBzaIhoOehRfpZRc+P4gXAaPvo36PC1ZJjmgzRD6etHJKSM
         VB2w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:message-id:date:subject:from:to;
        bh=AcafBmWjtt8pobLyfk/O93P08+xv/A6AO4gP7r6A0pI=;
        b=gB2OQWkIc7u6mfjc5l9T6umyFBasInqetcEHqQcXbuymmKS5DpqDE8MwYpI62OmVWV
         gqrP3E+lf43acVMjslMWQUXuXJQctZMEKkehiN7eA2QeUQd35vWKpjXpuFRBHHLIcin2
         XNC8WqwF95XGITPKI9kG78XhdS8h+BVmxVws/rRUA7yqgP/gALPZzeks70Q1p6dh1zkj
         Z88ucz2OeOM55EiFha6gKbuLr+0RfZDsquopvxipJjaJhHkcdLqW9xfLf/kgSvD9PdiL
         NMJYsnIcgLZ02VtV0RjgK0+/9M/SPtB28nncx8wqP0Z2/fY1MiH+uWMmaH3lvNmgoTLQ
         3dIQ==
X-Gm-Message-State: AD7BkJLZUbRwOBaDX4rnT/kKOc5n3NPdUn4PbtoJeh45PKy3qlm7fE9kOBBa5YLgCLErp694wJeXHnGj7LiR2Q==
MIME-Version: 1.0
X-Received: by 10.31.11.75 with SMTP id 72mr11424050vkl.2.1458996004582; Sat,
 26 Mar 2016 05:40:04 -0700 (PDT)
Message-ID: <001a1146937894fe1e052ef2fa6a@google.com>
Date: Sat, 26 Mar 2016 12:40:04 +0000
Subject: Test Email markup - Sat Mar 26 2016 15:40:04 GMT+0300 (EAT)
From: XXXXXXX@gmail.com
To: XXXXXXX@gmail.com
Content-Type: multipart/alternative; boundary=001a1146937894fe08052ef2fa67

--001a1146937894fe08052ef2fa67
Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes

I did it!

--001a1146937894fe08052ef2fa67
Content-Type: text/html; charset=ISO-8859-1

<html>
    <head>
        <title>Sample Title</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    </head>
    <body>
        <script type="application/ld+json">
{
    "@context": "http://schema.org",
    "@type": "EventReservation",
    "reservationNumber": "1231231234",
    "underName": {
        "@type": "Person",
        "name": "John Smith"
    },
    "reservationStatus": "http://schema.org/Confirmed",
    "reservationFor": {
        "@type": "Event",
        "name": "ProductCamp Helsinki 2016",
        "startDate": "2016-04-09T10:00:00+03:00",
        "endDate": "2016-04-09T16:00:00+03:00",
        "location": {
            "@type": "Place",
            "name": "OP Headquarters",
            "address": {
                "@type": "PostalAddress",
                "streetAddress": "Teollisuuskatu 1E00510 Helsinki",
                "addressLocality": "Helsinki",
                "addressRegion": "",
                "postalCode": "00510",
                "addressCountry": "FI"
            }
        }
    }
}
        </script>
        <b>I did it!</b>
    </body>
</html>
--001a1146937894fe08052ef2fa67--

我尝试做同样的事情(and asked a similar question) and reached the conclusion that the problem is that Inbox ignores structured data unless the email is authenticated using DKIM(以减少垃圾邮件)。我不知道如何使用 Gmail API 启用身份验证,所以我选择使用Google Apps 脚本函数 MailApp.sendEmail() 而不是,因为它会发送经过身份验证的电子邮件。