2014-11-08 114 views
2

我想在Gmail中测试Googles markup集成,但不起作用。从Gmail中schema.org标记不适用于Gmail的电子邮件

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

和继承人的原始邮件:

我从getting started页面从我的地址发送HTML邮件,使用此代码我的地址

Return-Path: <[email protected]> 
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 <[email protected]> 
     (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: <[email protected]> 
To: [email protected] 
From: Xaver <[email protected]> 
Reply-To: Xaver <[email protected]> 
Subject: The subject 
Message-ID: <[email protected]> 
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中:

enter image description here

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

+0

你是否解决了这个问题?我面临同样的问题http://stackoverflow.com/questions/28216823/gmail-email-markup-not-working – jlhonora 2015-01-29 18:09:26

回答

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”属性更改“内容”值实际指挥网址,并尝试重新发送电子邮件。

您也可以在此Email Markup Tester中测试您的标记,以确保您在标记中添加了所有缺失/推荐的属性。

希望有帮助!

相关问题