2016-03-26 87 views
2

我在電子郵件中添加EventReservation JSON-LD(使用Chrome擴展的gmail API從我發送)。谷歌(收件箱,Gmail,現在)不識別EventReservation

它已成功發送到我的收件箱,但谷歌不承認這是一個事件。這是來自發送郵件的電子郵件正文轉儲(HTML部分通過谷歌結構化數據測試工具和yandex結構化數據驗證程序成功驗證,實際上json是從我的收件箱中分析的真實事件複製粘貼的,所以腳本應該很好):

Received: from 236444161893 
    named unknown 
    by gmailapi.google.com 
    with HTTPREST; 
    Sat, 26 Mar 2016 07:34:52 -0400 
From: [email protected] 
To: [email protected] 
Subject: Lets Celebrate ! 
Content-Type: text/html; charset="utf-8" 
Date: Sat, 26 Mar 2016 07:34:52 -0400 
Message-Id: <[email protected]om> 


<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:此HTML作品,並通過收件箱解析,當我通過script.google.com(MailApp.sendEmail)發送,但如果是從Chrome擴展使用Gmail API(POST https://www.googleapis.com/gmail/v1/users/me/messages/send)發送不起作用。所以它看起來像電子郵件標題有問題。例如。從script.google.com發送「正確」的電子郵件包含DKIM-Signature等:

Delivered-To: [email protected] 
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: <[email protected].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 <[email protected]> 
     (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 [email protected].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 [email protected]; 
     spf=pass (google.com: domain of [email protected].google.com designates 2607:f8b0:400c:c05::245 as permitted sender) [email protected]aestro.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 <[email protected]>; 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: <[email protected]> 
Date: Sat, 26 Mar 2016 12:40:04 +0000 
Subject: Test Email markup - Sat Mar 26 2016 15:40:04 GMT+0300 (EAT) 
From: [email protected] 
To: [email protected] 
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-- 
+0

只是猜測:您是否嘗試將其發送到其他Gmail地址? – unor

+0

@unor,謝謝你的幫助。由於谷歌的限制,有可能自我測試此功能,所以我可以將它從我發送給我,而無需域名註冊。 –

+0

@AlexanderAlexeenko您也可以使用這個很酷的工具通過您的Gmail帳戶向您自己發送模式(http://gmail-actions.appspot.com)。我注意到你的活動即將到來(4月9日)。如果您想將此事件確認發送給您的用戶,我會立即註冊。 https://developers.google.com/gmail/markup/registering-with-google – Franco

回答

2

我試圖做同樣的事情(and asked a similar question),並得出結論,問題是,Inbox ignores structured data unless the email is authenticated using DKIM(以減輕垃圾郵件)。我無法確定如何使用Gmail API啓用身份驗證,因此我選擇使用Google Apps腳本功能MailApp.sendEmail()來代替,因爲它會發送經過身份驗證的電子郵件。

+0

但他們明確表示,您發送給自己的所有郵件(「從[email protected]到[email protected]」)始終處理。對於例如酒店預訂這對我很好。 – mbirth