Google allows you to interact with your email in a limited number of ways.
One way is to Click a button for example you want to confirm whether an email from a potential client needs attention.
And Creating and showing this button, is what we are going to walk through in this write up.
We want the user to click a button specified on our application/ld+json script.
{
"@context": "http://schema.org",
"@type": "SaveAction",
"name": "Ignore Person",
"handler": {
"@type": "HttpActionHandler",
"url": "https://example.com/ignore/person?messageId=xyz789",
"method": "HttpRequestMethod.GET"
}
}
- Full email html content
<html lang="en">
<body>
<p>
Dear John, Mark from Google responded to your email in Inbox (john@comapny.com)
</p>
<p>
MESSAGE DETAILS<br/>
Hi John<br/>
Your product looks great<br/>
but it is more expensive than what we use now<br/>
and we do not plan to switch.<br/>
Sincerely
</p>
<hr>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "SaveAction",
"name": "Ignore Person",
"handler": {
"@type": "HttpActionHandler",
"url": "https://example.com/ignore/person?messageId=xyz789",
"method": "HttpRequestMethod.GET"
}
}
</script>
</body>
</html>
- Go to Google's Email markup site and complete their apps-script-tutorial walkthrough.
NOTE that the tutorial relies on Google Apps Script technology to send email.
- Replace the html code you used in the apps-script-tutorial, with the one below
NOTE that we are using SaveAction instead of ViewAction
<html lang="en">
<body>
<p>
Dear John, Mark from Google responded to your email in Inbox (john@comapny.com)
</p>
<p>
MESSAGE DETAILS<br/>
Hi John<br/>
Your product looks great<br/>
but it is more expensive than what we use now<br/>
and we do not plan to switch.<br/>
Sincerely
</p>
<hr>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "SaveAction",
"name": "Ignore Person",
"handler": {
"@type": "HttpActionHandler",
"url": "https://example.com/ignore/person?messageId=xyz789",
"method": "HttpRequestMethod.GET"
}
}
</script>
</body>
</html>
-
Save the html and then resend the email as you did in the apps-script-tutorial
-
Open your gmail, then you should see an email with a Ignore Person button.
-
Now you can add custom buttons to your Gmail messages!
Use case was taken from one of Fusemachines products, Anna which helps sales people find forgotten emails from potential clients.