I'm trying to test Gmail's ability to handle embedded JSON-LD in an HTML message to show the corresponding action in the Inbox view, the introduction of which is described. I sent myself a message (using the Python API) for which I expect Gmail to display my view action, an example of which is shown here , however, nothing happens. I expect to see a link for "View File" similar to the one that will be displayed for booking flights, etc.
I am trying to figure out if there is a problem with my specific JSON-LD content, or if I am trying to do something that is not supported. The corresponding JSON-LD segment embedded in <body> is as follows:
<script type="application/ld+json"> { "@context": "http://schema.org", "@type": "CreativeWork", "@id": "http://my-site.com/file/1", "additionalType": "http://www.productontology.org/id/Computer_file", "name": "My File", "description": "View this file", "url": "http://my-site.com/file/1", "action": { "@type": "ViewAction", "url": "http://my-site.com/file/1", "name": "View File" } } </script>
If there is some problem with the way the email is encrypted, here it is in raw format (personal information changed)
Received: from 874510238733-ktbae5ftk223du75th86q0uua7i7rp5v.apps.googleusercontent.com named unknown by gmailapi.google.com with HTTPREST; Fri, 6 Mar 2015 14:54:52 -0800 Content-Type: multipart/alternative; boundary="===============5111695568485418487==" MIME-Version: 1.0 to: ****@gmail.com subject: A file has been shared to your email Date: Fri, 6 Mar 2015 14:54:52 -0800 Message-Id: < CADTCK+Vyd-bKWBJXMcs8eS1zQ-b34BanFzNKOBMVf_2dBiPB3A@mail.gmail.c om> From: ****@gmail.com --===============5111695568485418487== Content-Type: text/text; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit A new file is available. View this file <http://my-site.com/file/1> --===============5111695568485418487== Content-Type: text/html; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit <html> <body> <script type="application/ld+json"> { "@context": "http://schema.org", "@type": "CreativeWork", "@id": "http://my-site.com/file/1", "additionalType": "http://www.productontology.org/id/Computer_file", "name": "My File", "description": "View this file", "url": "http://my-site.com/file/1", "action": { "@type": "ViewAction", "url": "http://my-site.com/file/1", "name": "View File" } } </script> <div>A new file is available. <a href="http://my-site.com/file/1" target="_blank">View this file</a></div> </body> </html> --===============5111695568485418487==--