0

I know this can be done because i'm looking at an invoice from a telco in my gmail inbox mobile app but I don't know how to set the gmail markup / schema to make it happen.

The example I have shows:

August bill for xxxx
Total: $xxx, due MMM DD

$ Total amount due
$xxxx

Due date
DD MMM

Issuer
Telco X

Can anyone help? I can't find any guidance on the email markup pages on Google.

Community
  • 1
  • 1
AaronP
  • 3
  • 4
  • Can you post the markup found in the email from Telco X? Does the action show both in Gmail and Inbox? – Franco Aug 31 '15 at 17:48
  • Hi Franco, the action doesnt show in gmail only the inbox mobile app. I'll have a closer look at the actual email html and see if its got the invoice schema in it but I couldnt spot anything earlier. – AaronP Sep 01 '15 at 20:31
  • =20 =09=09 =09=09 Your account balance is $113.94, =09=09 =09=09 which you'll need to pay by 19 Sep 2015. =09=09
    – AaronP Sep 01 '15 at 21:05
  • this is the only part of the html that looks relant to interpretation for inbox action/events etc that and perhps the mail subject line - "Your latest Spark online bill is now available to view" (the whole email html was too big to post) – AaronP Sep 01 '15 at 21:05
  • I don't see the markup. Try doing a ctrl + f for "schema" in the raw source, you'll want to look for – Franco Sep 01 '15 at 22:05
  • Once you've found the markup in the email and modified it to your liking, you can use the following http://gmail-actions.appspot.com to send an email to yourself. You may also use Apps Script using this tutorial (https://developers.google.com/gmail/markup/apps-script-tutorial). – Franco Sep 01 '15 at 22:11
  • Thanks Franco we'll keep looking. If anyone has experience with schema/invoice implementations for gmail that would be good to find out. – AaronP Sep 02 '15 at 05:44
  • I've tried to search for this schema on the online documentation but couldn't find it. This is why I recommended to strip it from the raw source of the email you received. *It could be that the schema was only provided to certain Google partners only. I've seen a friend with a Comcast bill who received a "view bill" in Inbox with the same attributes you've mentioned. I would keep checking back on the following page for updates (https://developers.google.com/gmail/markup). – Franco Sep 02 '15 at 15:12
  • the documentation has been updated https://developers.google.com/gmail/markup/reference/invoice. – Franco Oct 27 '15 at 16:53

2 Answers2

1

It uses regular http://schema.org markup within the HTML of the email. See gmail markup reference. Example adapted from google's gmail markup example:

<div itemscope itemtype="http://schema.org/Order">
<div itemprop="merchant" itemscope itemtype="http://schema.org/Organization">
 <meta itemprop="name" content="Amazon.com"/>
</div>
<meta itemprop="orderNumber" content="123-4567890-1234567"/>
<meta itemprop="priceCurrency" content="USD"/>
<meta itemprop="price" content="259.99"/>
<div itemprop="acceptedOffer" itemscope itemtype="http://schema.org/Offer">
<div itemprop="itemOffered" itemscope itemtype="http://schema.org/Product">
  <meta itemprop="name" content="Samsung Chromebook"/>
  <meta itemprop="sku" content="B009LL9VDG"/>
  <link itemprop="url" href="https://rads.stackoverflow.com/amzn/click/com/B009LL9VDG" rel="nofollow noreferrer"/>
  <link itemprop="image" href="http://ecx.images-amazon.com/images/I/81H-DO3qX0L._SX522_.jpg"/>
</div>
<meta itemprop="price" content="249.99"/>
<meta itemprop="priceCurrency" content="USD"/>
<div itemprop="eligibleQuantity" itemscope itemtype="http://schema.org/QuantitativeValue">
  <meta itemprop="value" content="1"/>
</div>
<div itemprop="seller" itemscope itemtype="http://schema.org/Organization">
  <meta itemprop="name" content="Samsung Marketplace Store"/>
</div>
</div>
</div>
<div itemprop="priceSpecification" itemscope itemtype="http://schema.org/DeliveryChargeSpecification">
<meta itemprop="price" content="10.00"/>
<meta itemprop="priceCurrency" content="USD"/>
</div>
<link itemprop="url" href="https://www.amazon.ca/gp/css/summary/edit.html/orderID=123-4567890-1234567"/>
<div itemprop="potentialAction" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="target" href="https://www.amazon.ca/gp/css/summary/edit.html/orderID=123-4567890-1234567"/>
</div>
<link itemprop="orderStatus" href="http://schema.org/OrderStatus/OrderProcessing"/>

Mousey
  • 1,855
  • 19
  • 34
  • Hi Mousey, Ive been playing around with the google markup schema's and have sucessfully tested event and order schema's and have used actions with these to simulate an invoice. Thanks for posting the order schema but Im specifically wanting to setup Invoice schemas for utility B2C billing and genral B2B billing purposes. Thats why I was perplexed that my local telco *appears* to have an invoice schema setup for inbox but I cant see the schema defn anywhere on google. I have tried using the schema.org/invoice def as a gmail schema but couldnt get it working. Any assistance very welcome. – AaronP Sep 01 '15 at 20:36
  • @AaronP I posted the link at the top to the official gmail schema page. Schema.org is not a collaboration involving google rather than only relevant to google – Mousey Sep 02 '15 at 00:16
  • Cool thanks Mousey. Ive had a look at schema.org and see that its a stanbards group and that they have defined the invoice schema recently. Do you know if the google gmail markup implementation of invoice is public domain yet (I cant see it) and are there sample gmail markups for invoice? – AaronP Sep 02 '15 at 02:08
  • @AaronP here is the link from my answer - https://developers.google.com/gmail/markup/reference/order - it is in the public domain and as far as i can tell looks exactly the same as examples from schema.org - google have a Structured Data Testing Tool that you can check your schema in as well. – Mousey Sep 02 '15 at 13:52
  • Thanks mousey. Im good with orders, am interested in invoices. – AaronP Sep 02 '15 at 20:14
1

@AaronP, I've posted my findings and example in this issue similar to your question. Using schema.org/Invoice and schema.org/PayAction, I was able to get the email similar to what you received from Telco X. Keep in mind that this seems only active with Inbox and not Gmail.

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

enter image description here

Community
  • 1
  • 1
Franco
  • 566
  • 3
  • 12