Testing EmailMessage json in gmail - google-schemas

I also do not see the button in my test emails to myself. It is in a gmail account. Does the script tag have to come directly after the body tag? The email tester https://www.google.com/webmasters/markup-tester/ says the emails good and pulls out the script tag fine.
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "EmailMessage",
"description": "Answer",
"action": {
"#type": "ViewAction",
"url": "testuri",
"name": "Survey"
},
"publisher": {
"#type": "Organization",
"name": "Orgname",
"url": "https://www.Orgurl",
"url/googlePlus": "https://plus.google.com/+Orgname/posts"
}
}
</script>
For testing does it matter if it is a via?
"#gmail.com via amazonses.com"
I have the correct security stuff setup per the suggested testing. I see
mailed-by: amazonses.com and
signed-by: amazonses.com

Related

Reservation type who is not define is show in the Highlight section

I have recently add the json data to an email for show the highlight section in the email client for a train reservation but in the email there are also a advertising section for a care hire company and it's show this in the highlight too.
Is there a way to disable the RentalCar type in the email or to indicate to indicate to the client to ignoring a specific section of the html?
JSON-LD example
{
"reservationNumber": "XXXXX",
"reservationFor": {
"trainCompany": { "name": "Company", "#type": "Organization" },
"departureStation": { "name": "Departure station", "#type": "TrainStation" },
"arrivalStation": {
"name": "Arrival station",
"#type": "TrainStation"
},
"arrivalTime": "2018-08-15T12:47:00",
"#type": "TrainTrip"
},
"price": "10.00",
"reservationStatus": "http://schema.org/ReservationConfirmed",
"checkinUrl": "https://checkin-url.com/uk-en",
"modifyReservationUrl": "https://checkin-url.com/uk-en",
"#content": "http://schema.org",
"#type": "TrainReservation"}
Thanks
Damien

Test Schema in my own gmail id

<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "EmailMessage",
"potentialAction": {
"#type": "ConfirmAction",
"name": "Approve Expense",
"handler": {
"#type": "HttpActionHandler",
"url": "https://myexpenses.com/approve?expenseId=abc123"
}
},
"description": "Approval request for John's $10.13 expense for office supplies"
}
</script>
This is a sample schema I copied from the example. I am using gmail html client in chrome to send HTML emails using this tag.
Why doesn't the action show up? I am sending it to my own email and I received the email. But no actions are shown.

Order schema not showing right on Gmail

I'm trying to implement the Order schema as presented on : https://developers.google.com/gmail/markup/reference/order
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "Order",
"merchant": {
"#type": "Organization",
"name": "Test Ltd."
},
"orderNumber": "56d59b633427b",
"orderStatus": "http://schema.org/PaymentComplete",
"acceptedOffer": {
"#type": "Offer",
"itemOffered": {
"#type": "Product",
"name": "Test Products"
},
"price": "41.09",
"priceCurrency": "USD",
"eligibleQuantity": {
"#type": "QuantitativeValue",
"value": "1"
},
"url": "http://project1.local/account/tickets",
"potentialAction": {
"#type": "ViewAction",
"target": "http://project1.local/account/tickets"
}
}}
</script>
The issue is that the email shows like a normal email. What am I doing wrong?
Thank you!
PS: The code validates on https://developers.google.com/structured-data/testing-tool/
Try using the JSON I've posted below. PaymentComplete is not recognized, so I used OrderDelivered. You can find more info here:
https://schema.org/OrderStatus
I noticed the word "tickets" in your URL, are you intending to use the order schema for ticket confirmations? I would suggest using event reservation instead. Using this will integrate with Google Now cards and also input the event into the user's Calendar. You can still generate a action button by using url or modifyReservationurl.
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "Order",
"merchant": {
"#type": "Organization",
"name": "Test Ltd."
},
"orderNumber": "56d59b633427b",
"orderStatus": "http://schema.org/OrderDelivered",
"priceCurrency": "USD",
"price": "41.00",
"acceptedOffer": {
"#type": "Offer",
"itemOffered": {
"#type": "Product",
"name": "Test Products"
},
"price": "41.00",
"priceCurrency": "USD",
"eligibleQuantity": {
"#type": "QuantitativeValue",
"value": "1"
}
},
"url": "https://project1.local/account/tickets",
"potentialAction": {
"#type": "ViewAction",
"target": "https://project1.local/account/tickets"
}
}
</script>

Multiple email markups for Gmail and Inbox

Does Google support adding multiple markups in one email? For e.g i want to add an action button markup for Gmail and a Highlight markup for Inbox. Can this be done? I did not find any documentation for it.
Yes, having multiple markups is supported. For example, for a flight reservation.
All the code until "arrivalTime" is standard for a basic flight confirmation, but with the addition of "checkinUrl" you add a Go-To action to create a [Check In] button in Gmail.
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "FlightReservation",
"reservationNumber": "RXJ34P",
"reservationStatus": "http://schema.org/Confirmed",
"underName": {
"#type": "Person",
"name": "Eva Green"
},
"reservationFor": {
"#type": "Flight",
"flightNumber": "110",
"airline": {
"#type": "Airline",
"name": "United",
"iataCode": "UA"
},
"departureAirport": {
"#type": "Airport",
"name": "San Francisco Airport",
"iataCode": "SFO"
},
"departureTime": "2017-03-04T20:15:00-08:00",
"arrivalAirport": {
"#type": "Airport",
"name": "John F. Kennedy International Airport",
"iataCode": "JFK"
},
"arrivalTime": "2017-03-05T06:30:00-05:00"
},
"checkinUrl": "http://united.com/onlinecheckin.html",
"potentialAction": {
"#type": "CheckInAction",
"target": "http://united.com/onlinecheckin.html"
}
}
</script>

Reading the posted review and rating from Google review-action POST request

I am trying to integrate the review-action button in our review request mailers. Following is the schema used.
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "EmailMessage",
"action": {
"#type": "ReviewAction",
"review": {
"#type": "Review",
"itemReviewed": {
"#type": "Product",
"name": "Samsung Galaxy Duos 06-013"
},
"reviewRating": {
"#type": "Rating",
"bestRating": "5",
"worstRating": "1"
}
},
"handler": {
"#type": "HttpActionHandler",
"url": "http://dev.snapdeal.com/reviews/rateReviewGmailButton?pageId=215768&email=furqan8810#gmail.com&limitedAccessToken=97801e79-5d2d-42c0-ad88-8e6ac06ad032",
"requiredProperty": {
"#type": "Property",
"name": "review.reviewRating.ratingValue"
},
"optionalProperty": {
"#type": "Property",
"name": "review.reviewBody"
},
"method": "http://schema.org/HttpRequestMethod/POST"
}
},
"description": "We hope you liked Samsung Galaxy Duos 06-013 . Please tell us about it."
}
</script>
The review button appears in the email . However when the publish request is sent from the button the POSTed form data is something like this:
sma=%5B%22sma%22%2Cnull%2C%22msg-f%3A1470144207624023699%22%2C1402657061725%2C%220%3Aproduct%3A%22%2C%5B%220%3Aproduct%3A%22%2Cnull%2Cnull%2C%5Bnull%2Cnull%2Cnull%2Cnull%2C%5B%22Test%22%2C4%5D%2Cnull%2C%5B%5D%5D%2Cnull%2Cnull%2Cnull%2Cnull%2Cnull%2C%5B0%2C%22product%22%5D%5D%2C%221467005e20072e93%22%2C%5B0%2C%22product%22%5D%5D&
Decoded form:
sma=["sma",null,"msg-f:1470144207624023699",1402657061725,"0:product:",["0:product:",null,null,[null,null,null,null,["Test",4],null,[]],null,null,null,null,null,[0,"product"]],"1467005e20072e93",[0,"product"]]&
The above x-www-form urlencoded data does not seem to have any pattern for us to parse/extract the "review" and "rating" data that is embedded somewhere inside this data chunk.
Could you please help me in getting the posted data read inside my Spring MVC controller.

Resources