我试图发送一个航班确认电子邮件与标记,以得到突出显示的航班信息在Gmail。
这是标记:
<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不会显示航班高亮显示。我尝试了我的个人帐户作为寄件人和收件人,以无视注册要求,就像我读过这里,但这是行不通的。
你能给我一些提示吗?
发布于 2015-10-20 16:28:10
您的DateTime格式不正确。根据文件:
(预计DateTime值将采用ISO 8601格式,例如'2013-02-14T13:15:03-08:00‘(:mm:ssZ)。
当我测试您的标记时,我无法在收件箱中生成任何内容,但是,当我在您的标记中更改departureTime和arrivalTime属性时,我能够生成操作。
<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>
您应该得到以下结果,您也会注意到下面的第二个通知(巴塞罗那到马德里):
https://stackoverflow.com/questions/33236320
复制相似问题