How to add PayPal like structured data to Google email markup? - paypal

I was wondering how to achieve same email structure as PayPal has.
It looks like this (in Google's Inbox):
But I can't find right type for it here: https://developers.google.com/gmail/markup/reference/
Any idea how to achieve the PayPal-like markup?

Using schema.org/Invoice and schema.org/PayAction, I was able to get the email structure that you've posted from PayPal. It also generated a "View Bill" button, which only shows in Inbox and not Gmail. Check out my example script below. The email markup tester seemed to like it, there were no errors found. Try sending it using this Gmail Schema Tester or through Apps Script with your Gmail account.
<script type="application/ld+json">
[
{
"#context": "http://schema.org",
"#type": "Invoice",
"description": "January 2015 Acme Bill",
"url": "https://www.americanexpress.com",
"accountId": "xxxx-xxxx-xxxx-1234",
"potentialaction": {
"url": "https://example.com",
"#type": "PayAction"
},
"paymentDue": "2020-01-30",
"minimumPaymentDue": {
"#type": "PriceSpecification",
"price": "$15.00"
},
"totalPaymentDue": {
"#type": "PriceSpecification",
"price": "$200.00"
},
"paymentStatus": "payment due",
"provider": {
"#type": "Organization",
"name": "Acme Bank"
}
}
]
</script>
You should get this:

Related

Email template | Insert custom HTML block above the subject

Im trying to add gmail markups to the top of the order confirmation email like showed in the picture
I tried using the gmail provided markup code:
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "Order",
"merchant": {
"#type": "Organization",
"name": "Amazon.com"
},
"orderNumber": "123-4567890-1234567",
"priceCurrency": "USD",
"price": "29.99",
"acceptedOffer": {
"#type": "Offer",
"itemOffered": {
"#type": "Product",
"name": "Google Chromecast"
},
"price": "29.99",
"priceCurrency": "USD",
"eligibleQuantity": {
"#type": "QuantitativeValue",
"value": "1"
}
}
}
</script>
But with no luck.
Im using a docker with magento 2 and mailhog (locally). Mailhog recieves the order mail. The script exists in the <head> part (with inspect element) but does not get rendeded.
Also tried to sned that exact code using gmail.com to myself - it does not get rendered either.
What im missing?

Adding booking meta data to Google Search

I can't for the life of me figure out how this company adding this meta data to their Google search.
Does anyone know how to add the data and booking links like the below image?
Thanks
What you are seeing in these search results is what Google defines as "Rich Results" more information can be viewed in Google's Structured Data documentation. Specifically Edgewater Medical center is taking advantage of the event functionality to define times and dates.
This can be verified by pasting the page's source in the Rich Results Test tool, results for this page can be viewed at
https://search.google.com/test/rich-results?utm_campaign=devsite&utm_medium=jsonld&utm_source=event&id=m1ZrUywePCZ_NglFJIjZfg
According to google documentation in order to make this happen you have to follow a few steps:
Ensure that Googlebot can crawl your event pages (meaning, your pages
aren't protected by a robots.txt file or robots meta tag).
Ensure that your server can handle increased crawl rate.
Make sure you follow the Google guidelines.
Add structured data to your event pages. Currently, the event experience on Google only supports pages that focus on a single event. We recommend focusing on adding markup to your event posting pages instead of pages that list schedules or multiple events.
An example of such "structured data" for a standard event is shown below:
<html>
<head>
<title>The Adventures of Kira and Morrison</title>
<script type="application/ld+json">
{
"#context": "https://schema.org",
"#type": "Event",
"name": "The Adventures of Kira and Morrison",
"startDate": "2025-07-21T19:00-05:00",
"endDate": "2025-07-21T23:00-05:00",
"eventAttendanceMode": "https://schema.org/OfflineEventAttendanceMode",
"eventStatus": "https://schema.org/EventScheduled",
"location": {
"#type": "Place",
"name": "Snickerpark Stadium",
"address": {
"#type": "PostalAddress",
"streetAddress": "100 West Snickerpark Dr",
"addressLocality": "Snickertown",
"postalCode": "19019",
"addressRegion": "PA",
"addressCountry": "US"
}
},
"image": [
"https://example.com/photos/1x1/photo.jpg",
"https://example.com/photos/4x3/photo.jpg",
"https://example.com/photos/16x9/photo.jpg"
],
"description": "The Adventures of Kira and Morrison is coming to Snickertown in a can’t miss performance.",
"offers": {
"#type": "Offer",
"url": "https://www.example.com/event_offer/12345_201803180430",
"price": "30",
"priceCurrency": "USD",
"availability": "https://schema.org/InStock",
"validFrom": "2024-05-21T12:00"
},
"performer": {
"#type": "PerformingGroup",
"name": "Kira and Morrison"
},
"organizer": {
"#type": "Organization",
"name": "Kira and Morrison Music",
"url": "https://kiraandmorrisonmusic.com"
}
}
</script>
</head>
<body>
</body>
</html>

How to add Skype information to contact structured data?

I have these structured data for my contact page:
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "Organization",
"url": "https://mysupersite.net/",
"logo": "https://mysupersite.net/mysuperlogo.png",
"contactPoint": [{
"#type": "ContactPoint",
"telephone": "+7 (495) 509-61-20",
"email": "some#email.net",
"contactType": "customer service"
}]
}
</script>
How can I add information about my Skype contact here?
I think you should put Skype under Social Links not under Phone Contact.
Phone contacts extract the real phone number. Skype is a Link. Use skype://myskypelink
For Skype (and similar usecases like WhatsApp, Signal and other messaging services), you could create a dedicated ContactPoint for each. According to the ContactPoint schema documentation, you can put the handle into identifier and use contactType and / or description to tell what this contact point is about:
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "Organization",
"url": "https://mysupersite.net/",
"logo": "https://mysupersite.net/mysuperlogo.png",
"contactPoint": [
{
"#type": "ContactPoint",
"contactType": "customer service",
"telephone": "+7 (495) 509-61-20",
"email": "some#email.net"
},
{
"#type": "ContactPoint",
"contactType": "customer service (Skype)",
"identifier": "YourSkypeUserName",
"url": "skype:YourSkypeUserName?call"
},
{
"#type": "ContactPoint",
"contactType": "customer service (WhatsApp)",
"identifier": "+74955096120"
}
]
}
</script>
As seen with the Skype contact, where available, where available URLs should be provided that represent the contact point information (see: Skype URI Reference). The code above can be further enhanced by using an identifier of type PropertyValue (example).

Event emails - auto accepted by google calendar

I'm wondering how airline companies, evites and big events manage to create emails that are formatted specifically for the event as seen below:
and also adds this event automatically to google calendar.
Can anyone direct me to any tutorial or explanation on the methods used?
I searched endlessly and found nothing.
What you describe is a result of adding a bit of markup to your emails: https://developers.google.com/gmail/markup/getting-started
An example event:
<script type="application/ld+json"> [ {
"#context": "http://schema.org/",
"#type": "EventReservation",
"reservationnumber": "9454as",
"reservationfor": {
"image": "whatever image url",
"name": "My event",
"#type": "Event",
"enddate": "2016-01-06T20:00:00+00:00",
"startdate": "2016-01-06T17:00:00+00:00",
"location": {
"name": "11th Street",
"#type": "Place"
} } } ] </script>
Before that make sure to do the registration steps described here:
https://developers.google.com/gmail/markup/registering-with-google

Gmail ReviewAction Schema not POSTing to service

I marked up my email and sent it using the Gmail App Script tutorial.
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "EmailMessage",
"action": {
"#type": "ReviewAction",
"review": {
"#type": "Review",
"itemReviewed": {
"#type": "FoodEstablishment",
"name": "Joe's Diner"
},
"reviewRating": {
"#type": "Rating",
"bestRating": "5",
"worstRating": "1"
}
},
"handler": {
"#type": "HttpActionHandler",
"url": "http://gmail-demo-heroku-123.herokuapp.com/review",
"requiredProperty": {
"#type": "Property",
"name": "review.reviewRating.ratingValue"
},
"optionalProperty": {
"#type": "Property",
"name": "review.reviewBody"
},
"method": "http://schema.org/HttpRequestMethod/POST"
}
},
"description": "We hope you enjoyed your meal at Joe's Diner. Please tell us about it."
}
</script>
It shows up correctly in my inbox. It shows a review button. When I click on it it has a field for the body of the review and 5 stars that you can select. The Call To Action says publish on Gmail.com which is a little strange (and may point to the core issue), but I'm not sure.
When I click on the review button in Gmail and fill out the form, it provides the following error when I submit it.
Unable to send rating to gmail.com. Click on the stars again to retry.
The endpoint I provide can be reached and returns a 200 when I call it from console.
payload = {'review.reviewRating.ratingValue' : '2.0', 'review.reviewBody' : 'incredible'}
requests.post('http://gmail-demo-heroku-123.herokuapp.com/review',payload)
<Response [200]>
Why is Gmail giving this error? Is there a good way to debug this request coming from Gmail? Also, why is the Review Card saying Publish to Gmail.com in the Call To Action? The Schema.org markup appears to be correct in the email.