2014-11-08 54 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中測試您的標記,以確保您在標記中添加了所有缺失/推薦的屬性。

希望有幫助!

相關問題