使用 Google 电子邮件标记定义账单或发票

Defining a bill or invoice using Google email markup

我知道这可以做到,因为我正在我的 gmail 收件箱移动应用程序中查看电信公司的发票,但我不知道如何设置 gmail 标记/架构来实现它。

我的例子显示:

August bill for xxxx
Total: $xxx, due MMM DD

$ Total amount due
$xxxx

Due date
DD MMM

Issuer
Telco X

有人能帮忙吗? 我在 Google.

的电子邮件标记页面上找不到任何指导

它使用常规http://schema.org markup within the HTML of the email. See gmail markup reference。 改编自 google 的 gmail 标记示例的示例:

<div itemscope itemtype="http://schema.org/Order">
<div itemprop="merchant" itemscope itemtype="http://schema.org/Organization">
 <meta itemprop="name" content="Amazon.com"/>
</div>
<meta itemprop="orderNumber" content="123-4567890-1234567"/>
<meta itemprop="priceCurrency" content="USD"/>
<meta itemprop="price" content="259.99"/>
<div itemprop="acceptedOffer" itemscope itemtype="http://schema.org/Offer">
<div itemprop="itemOffered" itemscope itemtype="http://schema.org/Product">
  <meta itemprop="name" content="Samsung Chromebook"/>
  <meta itemprop="sku" content="B009LL9VDG"/>
  <link itemprop="url" href="https://rads.whosebug.com/amzn/click/com/B009LL9VDG" rel="nofollow noreferrer"/>
  <link itemprop="image" href="http://ecx.images-amazon.com/images/I/81H-DO3qX0L._SX522_.jpg"/>
</div>
<meta itemprop="price" content="249.99"/>
<meta itemprop="priceCurrency" content="USD"/>
<div itemprop="eligibleQuantity" itemscope itemtype="http://schema.org/QuantitativeValue">
  <meta itemprop="value" content="1"/>
</div>
<div itemprop="seller" itemscope itemtype="http://schema.org/Organization">
  <meta itemprop="name" content="Samsung Marketplace Store"/>
</div>
</div>
</div>
<div itemprop="priceSpecification" itemscope itemtype="http://schema.org/DeliveryChargeSpecification">
<meta itemprop="price" content="10.00"/>
<meta itemprop="priceCurrency" content="USD"/>
</div>
<link itemprop="url" href="https://www.amazon.ca/gp/css/summary/edit.html/orderID=123-4567890-1234567"/>
<div itemprop="potentialAction" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="target" href="https://www.amazon.ca/gp/css/summary/edit.html/orderID=123-4567890-1234567"/>
</div>
<link itemprop="orderStatus" href="http://schema.org/OrderStatus/OrderProcessing"/>

@AaronP,我已经在 issue 中发布了我的发现和示例,与您的问题类似。使用 schema.org/Invoice 和 schema.org/PayAction,我能够收到类似于您从 Telco X 收到的电子邮件。请记住,这似乎只在收件箱中有效,在 Gmail 中无效。

 <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": ".00"
    },
    "totalPaymentDue": {
      "@type": "PriceSpecification",
      "price": "0.00"
    },
    "paymentStatus": "payment due",
    "provider": {
      "@type": "Organization",
      "name": "Acme Bank"
 }
}
]
    </script>

你应该得到这个: