我知道这可以做到,因为我正在查看我的gmail收件箱移动应用中的电信公司的发票,但我不知道如何设置gmail标记/架构以实现它。
我的例子显示:
8月xxxx的账单
总计:$ xxx,到期MMM DD$应付总额
$ XXXX截止日期
DD MMM发行人
Telco X
有人可以帮忙吗? 我在Google上的电子邮件标记页面上找不到任何指导。
答案 0 :(得分:1)
它在电子邮件的HTML中使用常规http://schema.org标记。见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.stackoverflow.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"/>
答案 1 :(得分:1)
@AaronP,我已经在issue中发布了我的发现和示例,与您的问题类似。使用schema.org/Invoice和schema.org/PayAction,我能够收到类似于从Telco X收到的电子邮件。请记住,这似乎仅适用于Inbox而非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": "$15.00"
},
"totalPaymentDue": {
"@type": "PriceSpecification",
"price": "$200.00"
},
"paymentStatus": "payment due",
"provider": {
"@type": "Organization",
"name": "Acme Bank"
}
}
]
</script>
&#13;
你应该得到这个: