首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >电子邮件标记不起作用

电子邮件标记不起作用
EN

Stack Overflow用户
提问于 2015-10-20 12:10:59
回答 1查看 979关注 0票数 0

我试图发送一个航班确认电子邮件与标记,以得到突出显示的航班信息在Gmail。

这是标记:

代码语言:javascript
运行
复制
    <script type="application/ld+json">
    [       
            {
            "@context": "http://schema.org",
            "@type": "FlightReservation",
            "reservationNumber": "PNR TEST",
            "reservationStatus": "http://schema.org/Confirmed",
            "underName": {
            "@type": "Person",
            "name": "Prenom Nom"
            },
            "reservationFor": {
            "@type": "Flight",
            "flightNumber": "2712",
            "airline": {"@type": "Airline","name": "IBERIA","iataCode": "IB"},
            "departureAirport": {"@type": "Airport","name": "Madrid","iataCode": "MAD"},
            "departureTime": "Tue Sep 08 06:50:00 CEST 2015",
            "arrivalAirport": {"@type": "Airport","name": "Barcelona","iataCode": "BCN"},
            "arrivalTime": "Tue Sep 08 08:00:00 CEST 2015"
            }
            },          
            {
            "@context": "http://schema.org",
            "@type": "FlightReservation",
            "reservationNumber": "PNR TEST",
            "reservationStatus": "http://schema.org/Confirmed",
            "underName": {
            "@type": "Person",
            "name": "Prenom Nom"
            },
            "reservationFor": {
            "@type": "Flight",
            "flightNumber": "2739",
            "airline": {"@type": "Airline","name": "IBERIA","iataCode": "IB"},
            "departureAirport": {"@type": "Airport","name": "Barcelona","iataCode": "BCN"},
            "departureTime": "Thu Sep 10 06:50:00 CEST 2015",
            "arrivalAirport": {"@type": "Airport","name": "Madrid","iataCode": "MAD"},
            "arrivalTime": "Thu Sep 10 08:10:00 CEST 2015"
            }
            }   ]
</script>

当我不包括这个标记在电子邮件中,gmail是自动显示航班信息,但有时有一些错误的信息。

现在,当我包含传递Google标记测试的标记时,Gmail不会显示航班高亮显示。我尝试了我的个人帐户作为寄件人和收件人,以无视注册要求,就像我读过这里,但这是行不通的。

你能给我一些提示吗?

EN

回答 1

Stack Overflow用户

发布于 2015-10-20 16:28:10

您的DateTime格式不正确。根据文件:

(预计DateTime值将采用ISO 8601格式,例如'2013-02-14T13:15:03-08:00‘(:mm:ssZ)。

当我测试您的标记时,我无法在收件箱中生成任何内容,但是,当我在您的标记中更改departureTimearrivalTime属性时,我能够生成操作。

代码语言:javascript
运行
复制
<script type="application/ld+json">
    [       
            {
            "@context": "http://schema.org",
            "@type": "FlightReservation",
            "reservationNumber": "PNR TEST",
            "reservationStatus": "http://schema.org/Confirmed",
            "underName": {
            "@type": "Person",
            "name": "Prenom Nom"
            },
            "reservationFor": {
            "@type": "Flight",
            "flightNumber": "2712",
            "airline": {"@type": "Airline","name": "IBERIA","iataCode": "IB"},
            "departureAirport": {"@type": "Airport","name": "Madrid","iataCode": "MAD"},
            "departureTime": "2015-10-20T13:15:03-08:00",
            "arrivalAirport": {"@type": "Airport","name": "Barcelona","iataCode": "BCN"},
            "arrivalTime": "2015-10-20T18:15:03-08:00"
            }
            },          
            {
            "@context": "http://schema.org",
            "@type": "FlightReservation",
            "reservationNumber": "PNR TEST",
            "reservationStatus": "http://schema.org/Confirmed",
            "underName": {
            "@type": "Person",
            "name": "Prenom Nom"
            },
            "reservationFor": {
            "@type": "Flight",
            "flightNumber": "2739",
            "airline": {"@type": "Airline","name": "IBERIA","iataCode": "IB"},
            "departureAirport": {"@type": "Airport","name": "Barcelona","iataCode": "BCN"},
            "departureTime": "2015-10-21T13:15:03-08:00",
            "arrivalAirport": {"@type": "Airport","name": "Madrid","iataCode": "MAD"},
            "arrivalTime": "2015-10-21T18:15:03-08:00"
            }
            }   ]
</script>

您应该得到以下结果,您也会注意到下面的第二个通知(巴塞罗那到马德里):

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33236320

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档