Google apps script schema.org标记不适用于gmail的电子邮件

Google apps script schema.org标记不适用于gmail的电子邮件,google-apps-script,gmail,google-schemas,Google Apps Script,Gmail,Google Schemas,我想在Gmail中测试集成,但不起作用 我正在从我的地址向我的地址发送带有以下代码的html消息: <html> <body> <div itemscope itemtype="http://schema.org/EventReservation"> <meta itemprop="reservationNumber" content="IO12345"/> <div itemprop="underName

我想在Gmail中测试集成,但不起作用

我正在从我的地址向我的地址发送带有以下代码的html消息:

<html>
  <body>
    <div itemscope itemtype="http://schema.org/EventReservation">
      <meta itemprop="reservationNumber" content="IO12345"/>
      <div itemprop="underName" itemscope itemtype="http://schema.org/Person">
        <meta itemprop="name" content="John Smith"/>
      </div>
      <div itemprop="reservationFor" itemscope itemtype="http://schema.org/Event">
        <meta itemprop="name" content="Google I/O 2013"/>
        <time itemprop="startDate" datetime="2013-05-15T08:30:00-08:00"/>
        <div itemprop="location" itemscope itemtype="http://schema.org/Place">
          <meta itemprop="name" content="Moscone Center"/>
          <div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
            <meta itemprop="streetAddress" content="800 Howard St."/>
            <meta itemprop="addressLocality" content="San Francisco"/>
            <meta itemprop="addressRegion" content="CA"/>
            <meta itemprop="postalCode" content="94103"/>
            <meta itemprop="addressCountry" content="US"/>
          </div>
        </div>
      </div>
    </div>
    <p>
      Dear John, thanks for booking your Google I/O ticket with us.
    </p>
    <p>
      BOOKING DETAILS<br/>
      Reservation number: IO12345<br/>
      Order for: John Smith<br/>
      Event: Google I/O 2013<br/>
      Start time: May 15th 2013 8:00am PST<br/>
      Venue: Moscone Center, 800 Howard St., San Francisco, CA 94103<br/>
    </p>
  </body>
</html>


亲爱的John,感谢您与我们一起预订Google I/O票证。

预订详情
预订号码:IO12345
订购:约翰·史密斯
事件:谷歌I/O 2013
开始时间:2013年5月15日太平洋标准时间上午8:00
地点:莫斯康展览中心,800 Howard St.,旧金山,CA 94103

以下是来自Gmail的原始电子邮件:

Return-Path: <XXX@gmail.com>
Received: from wordpress.dev (cm56-177-12.liwest.at. [86.56.177.12])
        by mx.google.com with ESMTPSA id p8sm10051916wia.1.2014.11.08.08.27.23
        for <XXX@gmail.com>
        (version=TLSv1 cipher=RC4-SHA bits=128/128);
        Sat, 08 Nov 2014 08:27:23 -0800 (PST)
Date: Sat, 8 Nov 2014 16:27:23 +0000
Return-Path: <XXX@gmail.com>
To: XXX@gmail.com
From: Xaver <XXX@gmail.com>
Reply-To: Xaver <XXX@gmail.com>
Subject: The subject
Message-ID: <d612b709afcf37679e1dfa5306055873@wordpress.dev>
X-Priority: 3
X-Mailer: PHPMailer 5.2.7 (https://github.com/PHPMailer/PHPMailer/)
MIME-Version: 1.0
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<html>
  <body>
    <div itemscope itemtype="http://schema.org/EventReservation">
      <meta itemprop="reservationNumber" content="IO12345"/>
      <div itemprop="underName" itemscope itemtype="http://schema.org/Person">
        <meta itemprop="name" content="John Smith"/>
      </div>
      <div itemprop="reservationFor" itemscope itemtype="http://schema.org/Event">
        <meta itemprop="name" content="Google I/O 2013"/>
        <time itemprop="startDate" datetime="2013-05-15T08:30:00-08:00"/>
        <div itemprop="location" itemscope itemtype="http://schema.org/Place">
          <meta itemprop="name" content="Moscone Center"/>
          <div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
            <meta itemprop="streetAddress" content="800 Howard St."/>
            <meta itemprop="addressLocality" content="San Francisco"/>
            <meta itemprop="addressRegion" content="CA"/>
            <meta itemprop="postalCode" content="94103"/>
            <meta itemprop="addressCountry" content="US"/>
          </div>
        </div>
      </div>
    </div>
    <p>
      Dear John, thanks for booking your Google I/O ticket with us.
    </p>
    <p>
      BOOKING DETAILS<br/>
      Reservation number: IO12345<br/>
      Order for: John Smith<br/>
      Event: Google I/O 2013<br/>
      Start time: May 15th 2013 8:00am PST<br/>
      Venue: Moscone Center, 800 Howard St., San Francisco, CA 94103<br/>
    </p>
  </body>
</html>
返回路径:
收到:来自wordpress.dev(cm56-177-12.liwest.at.[86.56.177.12])
通过mx.google.com和ESMTPSA id p8sm10051916wia.1.2014.11.08.08.27.23
对于
(版本=TLSv1密码=RC4-SHA位=128/128);
2014年11月8日星期六08:27:23-0800(太平洋标准时间)
日期:2014年11月8日星期六16:27:23+0000
返回路径:
致:XXX@gmail.com
发件人:Xaver
答复:Xaver
主题:主题
消息ID:
X优先级:3
X-Mailer:PHPMailer 5.2.7(https://github.com/PHPMailer/PHPMailer/)
MIME版本:1.0
内容类型:text/html;字符集=UTF-8
内容传输编码:8比特

亲爱的John,感谢您与我们一起预订Google I/O票证。

预订详情
预订号码:IO12345
订购:约翰·史密斯
事件:谷歌I/O 2013
开始时间:2013年5月15日太平洋标准时间上午8:00
地点:莫斯康展览中心,800 Howard St.,旧金山,CA 94103

它在GMail中的外观:


我是从我当地的环境发送的。有什么我遗漏的吗?

上面的电子邮件标记包含定义事件保留的最小信息集

您可以在电子邮件中标记其他信息,以改善用户体验。例如,要获得一个动作按钮,您应该考虑在标记中添加“MulfFyReaveValueURL”。 修改了上述标记以在电子邮件中生成操作按钮

<html>
  <body>
<div itemscope itemtype="http://schema.org/EventReservation">
  <meta itemprop="reservationNumber" content="E123456789"/>
  <link itemprop="reservationStatus" href="http://schema.org/Confirmed"/>
  <div itemprop="underName" itemscope itemtype="http://schema.org/Person">
    <meta itemprop="name" content="John Smith"/>
  </div>
  <div itemprop="reservationFor" itemscope itemtype="http://schema.org/Event">
    <meta itemprop="name" content="Foo Fighters Concert"/>
    <meta itemprop="startDate" content="2017-03-06T20:00:00-08:00"/>
    <div itemprop="location" itemscope itemtype="http://schema.org/Place">
      <meta itemprop="name" content="AT&T Park"/>
      <div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
    <meta itemprop="streetAddress" content="24 Willie Mays Plaza"/>
    <meta itemprop="addressLocality" content="San Francisco"/>
    <meta itemprop="addressRegion" content="CA"/>
    <meta itemprop="postalCode" content="94107"/>
    <meta itemprop="addressCountry" content="US"/>
      </div>
    </div>
  </div>
  <meta itemprop="modifiedTime" content="2013-05-01T08:00:00-08:00"/>
<meta itemprop="modifyReservationUrl" content="http://www.google.com"/>
</div>
    <p>
      Dear John, thanks for booking your Google I/O ticket with us.
    </p>
    <p>
      BOOKING DETAILS<br/>
      Reservation number: IO12345<br/>
      Order for: John Smith<br/>
      Event: Google I/O 2013<br/>
      Start time: May 15th 2013 8:00am PST<br/>
      Venue: Moscone Center, 800 Howard St., San Francisco, CA 94103<br/>
    </p>
  </body>
</html>


亲爱的John,感谢您与我们一起预订Google I/O票证。

预订详情
预订号码:IO12345
订购:约翰·史密斯
事件:谷歌I/O 2013
开始时间:2013年5月15日太平洋标准时间上午8:00
地点:莫斯康展览中心,800 Howard St.,旧金山,CA 94103

您可以将“modifyReservationUrl”属性中的“内容”值更改为实际的定向url,然后尝试重新发送电子邮件

<html>
  <body>
<div itemscope itemtype="http://schema.org/EventReservation">
  <meta itemprop="reservationNumber" content="E123456789"/>
  <link itemprop="reservationStatus" href="http://schema.org/Confirmed"/>
  <div itemprop="underName" itemscope itemtype="http://schema.org/Person">
    <meta itemprop="name" content="John Smith"/>
  </div>
  <div itemprop="reservationFor" itemscope itemtype="http://schema.org/Event">
    <meta itemprop="name" content="Foo Fighters Concert"/>
    <meta itemprop="startDate" content="2017-03-06T20:00:00-08:00"/>
    <div itemprop="location" itemscope itemtype="http://schema.org/Place">
      <meta itemprop="name" content="AT&T Park"/>
      <div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
    <meta itemprop="streetAddress" content="24 Willie Mays Plaza"/>
    <meta itemprop="addressLocality" content="San Francisco"/>
    <meta itemprop="addressRegion" content="CA"/>
    <meta itemprop="postalCode" content="94107"/>
    <meta itemprop="addressCountry" content="US"/>
      </div>
    </div>
  </div>
  <meta itemprop="modifiedTime" content="2013-05-01T08:00:00-08:00"/>
<meta itemprop="modifyReservationUrl" content="http://www.google.com"/>
</div>
    <p>
      Dear John, thanks for booking your Google I/O ticket with us.
    </p>
    <p>
      BOOKING DETAILS<br/>
      Reservation number: IO12345<br/>
      Order for: John Smith<br/>
      Event: Google I/O 2013<br/>
      Start time: May 15th 2013 8:00am PST<br/>
      Venue: Moscone Center, 800 Howard St., San Francisco, CA 94103<br/>
    </p>
  </body>
</html>
您还可以在此中测试标记,以确保在标记中添加所有缺少/推荐的属性


希望有帮助

你能澄清一下什么不起作用吗。我猜您正在尝试将事件添加到用户的日历中,但没有添加到那里

您是否已完成注册和白名单步骤?

如果你的标记是从一个谷歌还没有批准修改他人gCals的帐户发送的,那么你的标记是否正确并不重要

此外,google指出schema.org上的标准优先于标记页面上记录的标准。例如,“reservationId”似乎取代了“reservationNumber”。令人困惑的是,谷歌提供了一个测试工具,称“reservationNumber”是正确答案:

…第二个测试工具说“reservationId”是正确的答案:


当我通过注册和白名单时,他们给我指出了那个问题。

你解决了这个问题吗?我面临着同样的问题,你不需要注册就可以从你自己的Gmail地址测试到同一个Gmail地址。这在入门文档中指定。