如何将PayPal之类的结构化数据添加到Google电子邮件标记中? [英] How to add PayPal like structured data to Google email markup?

查看:101
本文介绍了如何将PayPal之类的结构化数据添加到Google电子邮件标记中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何实现与PayPal相同的电子邮件结构.

I was wondering how to achieve same email structure as PayPal has.

看起来像这样(在Google的收件箱中):

It looks like this (in Google's Inbox):

但是我在这里找不到适合的类型:>://developers. google.com/gmail/markup/reference/

But I can't find right type for it here: https://developers.google.com/gmail/markup/reference/

有什么想法要实现类似PayPal的标记吗?

Any idea how to achieve the PayPal-like markup?

推荐答案

使用schema.org/Invoice和schema.org/PayAction,我可以从PayPal获取您发布的电子邮件结构.它还生成了一个查看帐单"按钮,该按钮仅显示在收件箱"中,而不显示在Gmail中.在下面查看我的示例脚本. 电子邮件标记测试器似乎很喜欢,没有发现错误.尝试使用此 Gmail Schema Tester 或通过

Using schema.org/Invoice and schema.org/PayAction, I was able to get the email structure that you've posted from PayPal. It also generated a "View Bill" button, which only shows in Inbox and not Gmail. Check out my example script below. The email markup tester seemed to like it, there were no errors found. Try sending it using this Gmail Schema Tester or through Apps Script with your Gmail account.

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

您应该得到这个:

这篇关于如何将PayPal之类的结构化数据添加到Google电子邮件标记中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆