2

我想在 Gmail 中测试Google 的标记集成,但不起作用。

我正在从我的地址到我的地址的入门页面发送带有此代码的 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>

以下是来自 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>

它在 GMail 中的外观:

在此处输入图像描述

我是从本地环境发送的。有什么我想念的吗?

4

2 回答 2

1

你能澄清什么是行不通的。我猜您正在尝试将事件添加到用户的日历中,但它没有被添加到那里?

您是否已完成注册和白名单步骤? https://developers.google.com/gmail/markup/registering-with-google

如果您的标记是从 Google 尚未清除以修改其他人的 gCal 的帐户发送的,则标记是否正确无关紧要。

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

https://www.google.com/webmasters/markup-tester/

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

https://search.google.com/structured-data/testing-tool#

当我完成注册和白名单时,他们向我指出了那个。

于 2019-12-20T01:12:11.503 回答
0

上述电子邮件标记包含定义事件预订的最少信息集。

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

修改了上述标记以在电子邮件中生成操作按钮。

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

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

您还可以在此电子邮件标记测试器中测试您的标记,以确保您在标记中添加所有缺少/推荐的属性。

希望有帮助!

于 2014-11-12T17:53:10.910 回答