Xaver
Xaver

Reputation: 11662

schema.org markup for emails not working on gmail

I would like to test Googles markup integration in Gmail but isn't working.

I'm sending a html message with this code from the getting started page from my address to my address:

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

and heres the raw email from Gmail:

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>

How it looks in GMail:

enter image description here

I'm sending from my local environment. Is there anything I miss?

Upvotes: 2

Views: 1392

Answers (2)

Sam Brown
Sam Brown

Reputation: 63

Could you clarify what isn't working. I'd guess you're trying to add the event to the user's calendar, but it's not getting added there?

Have you completed the registration & whitelisting step? https://developers.google.com/gmail/markup/registering-with-google

Doesn't matter if your markup is correct if it's being sent from an account that google hasn't cleared to modify others' gCals.

Additionally, google indicates that the standards at schema.org take priority over the ones documented on the Markup page. For example, 'reservationId' seems to replace 'reservationNumber'. Confusingly, google provides one testing tool that says 'reservationNumber' is the correct answer:

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

...and a second testing tool that says 'reservationId' is the right answer:

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

They pointed me to that one when I went through registration & whitelisting.

Upvotes: 1

KRR
KRR

Reputation: 4917

The above email markup contains minimal set of information to define an Event Reservation.

You can markup other pieces of information in your emails to improve the user experience. For instance, to get a action button you should consider adding the "modifyReservationUrl" in the markup.

Modified the above markup to generate action button in the email.

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

You can change the "content" value in the "modifyReservationUrl" property to actual directing url and try re-sending the email.

You can also test your markup in this Email Markup Tester to make sure you are adding all the missing/recommended properties in the markup.

Hope that helps!

Upvotes: 0

Related Questions