3

我标记了我的电子邮件并使用 Gmail 应用脚本教程发送了它。

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

它正确显示在我的收件箱中。它显示了一个审查按钮。当我点击它时,它有一个评论正文的字段和你可以选择的 5 颗星。号召性用语说在 Gmail.com 上发布有点奇怪(可能指向核心问题),但我不确定。

当我点击 Gmail 中的审核按钮并填写表单时,提交时它会提供以下错误。

Unable to send rating to gmail.com. Click on the stars again to retry.

当我从控制台调用它时,可以到达我提供的端点并返回 200。

payload = {'review.reviewRating.ratingValue' : '2.0', 'review.reviewBody' : 'incredible'}
requests.post('http://gmail-demo-heroku-123.herokuapp.com/review',payload)
<Response [200]>

为什么 Gmail 会出现此错误?有没有一种好方法来调试来自 Gmail 的这个请求?另外,为什么评论卡在号召性用语中显示发布到 Gmail.com?电子邮件中的 Schema.org 标记似乎是正确的。

4

0 回答 0