How to send Google now cards from email using email markup

To send Google Now cards from email, you have to first register with Google and email markup. Google Now relies on structured data compatible with schema.org in emails to work. By using this, Google would understand the fields in email and will automatically construct a Google now card with relevant information. Right now, Schemas in Gmail support both JSON-LD and Microdata. You can either add Schema manually or use Markup helper.

Let’s say for example, that you are supposed to send Google I/O 2016 tickets to participants. Your ticket confirmation email contains the following:

<html>
<body>
<p>
Dear John, thanks for booking your Google I/O ticket with us.
</p>
<p>
BOOKING DETAILS
<br/>
Order for: John Smith
<br/>
Event: Google I/O 2013
<br/>
When: May 15th 2013 8:30am PST
<br/>
Venue: Moscone Center, 800 Howard St., San Francisco, CA 94103
<br/>
Reservation number: IO12345
<br/>
</p>
</body>
</html>

 

The following code shows how the markup email looks like:

 

<html>
  <body>
    <script type="application/ld+json">
    {
      "@context":             "http://schema.org",
      "@type":                "EventReservation",
      "reservationNumber":    "IO12345",
      "underName": "John Smith",
      "reservationFor": {
        "@type": "Event",
        "name":               "Google I/O 2013",
        "startDate":          "2013-05-15T08:30:00-08:00",
        "location":           "Moscone Center, 800 Howard St., San Francisco, CA 94103"
      }
    }
    </script>
    <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>

Leave a Reply