Вопрос

I am trying to add a Go-To Action to an outgoing email using the following page as a guide:

https://developers.google.com/gmail/schemas/reference/go-to-action

In testing, the action is not showing up. Here is the exact code I am using. I have tried both the JSON-LD and microdata formats.

JSON

<script type="application/ld+json">
{
  "@context": "schema.org",
  "@type": "EmailMessage",
  "action": {
    "url": "http://www.barbaraboxer.com/petitions/MSA?sc=RB_msa",
    "name": "Sign Now"
  },
  "description": "Sign on as a citizen co-sponsor of the Military Justice Improvement Act"
}
</script>

Microdata

<div itemscope itemtype="http://schema.org/EmailMessage">
  <div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
    <link itemprop="url" href="http://www.barbaraboxer.com/petitions/MSA?sc=RB_msa"/>
    <link itemprop="name" href="Sign Now"/>
  </div>
  <meta itemprop="description" content="Sign on as a citizen co-sponsor of the Military Justice Improvement Act"/>
</div>
Это было полезно?

Решение

The markup seems correct, however, as you are not a whitelisted sender yet, you can only try it by sending emails to yourself. All emails with schema must also be signed with DKIM or SPF to prove that you are the actual sender. How are you sending emails? Easy ways to have them signed include using Gmail SMTP or App Engine.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top