schema.orgjson-ldgoogle-schemasgoogle-now

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


I'm adding EventReservation JSON-LD into email (sent from me to me using gmail API from Chrome Extension).

It is successfully delivered into my inbox, but google doesn't recognize this as an event. Here it is email body dump from delivered email (HTML part is successfully validated by google structured data testing tool and yandex structured data validator, and actually json is copy-pasted from an real event that was parsed in my Inbox, so script should be good):

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

What could be wrong?

UPDATE: This HTML works and parsed by Inbox when I send it through script.google.com (MailApp.sendEmail), but doesn't work if it is sent from Chrome Extension using gmail API (POST https://www.googleapis.com/gmail/v1/users/me/messages/send) . So it looks like something wrong with email headers. E.g. "correct" email sent from script.google.com contains DKIM-Signature etc:

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--

Solution

  • I tried to do the same thing (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 (to mitigate against spam). I couldn't work out how to enable authentication using the Gmail API, so I opted for using the Google Apps Script function MailApp.sendEmail() instead, as that does send authenticated emails.