Wednesday 7 January 2015

Gmail Actions - Schema.org

There is an interesting thing which I found today in one of my email in Gmail account which I thought of sharing.
Below you would see a mail from ‘Meru Cabs’  with subject as ‘Meru Booking Status: CONFIRMED’ & beside it there is a link which says ‘Modify reservation’ (indicating an external link)


(It might be that you already know,why & how it’s there but in case you don’t J)




The button is something which I found to be unusual as it does not appear in other mails but surely makes this mail to be different & ‘clickable’.
On clicking it I was redirected to Meru cabs site.

What made me curious was how to create such emails, so I googled it & landed on this developers page https://developers.google.com/gmail/markup/overview.
The answer to it is that Meru used Schema.org meta-data in their emails which are widely supported/rendered by Google/Yahoo/ in order to provide such actions.

On viewing the mail source code I found the script as:

<script type=3D"application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "EventReservation",
  "reservationNumber": "33***2628",
  "reservationStatus": "http://schema.org/Confirmed",
  "underName": {
    "@type": "Person",
    "name": "Pankaj Khattar"
  },
  "reservationFor": {
    "@type": "Event",
    "name": "My Meru Cab Booking",
    "startDate": "2014-01-06T21:00:00+05:30",
    "location": { 
      "@type": "Place",
      "name": "NOIDA SECTOR",
      "address": {
        "@type": "PostalAddress",
        "streetAddress": "Sector, Noida, UP",
        "addressLocality": "Delhi",
        "addressRegion": "Delhi",
        "postalCode": "110001",
        "addressCountry": "India"
      }
    }
  },
  "modifiedTime": "2014-01-06T21:00:00+05:30",
  "modifyReservationUrl": "http://www.merucabs.com" 
}
</script>


The above script contains all the event information & hence informed Google about it, create that action button.
The developer page explains how to create such emails & add scripts in the mails.
Similar to above mail Gmail supports many other such actions like:
  • RSVP Action for events
  • Review Action for restaurants, movies, products and services
  • One-click Action for just about anything that can be performed with a single click
  • Go-to Action for more complex interactions
  • Flight interactive cards
Another important thing is that the event was also updated in the Google Calendar (there is another notification mail above that in the screenshot) & Google Now as well.
Hence the above actions actually helped in improving the user experience, and make it easy to take quick action.