我正在尝试发送带有标记的航班确认电子邮件,以便在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 Markup Test的标记时,Gmail不会显示Flight Highlight。我已将我的个人帐户作为发件人和收件人进行了尝试,以便忽略注册要求,例如我已阅读here,但这不起作用。
你可以给我一些指示吗?答案 0 :(得分:0)
您的DateTime格式不正确。根据文件:
(DateTime值应采用ISO 8601格式,例如&#39; 2013-02-14T13:15:03-08:00&#39;(YYYY-MM-DDTHH:mm: SSZ)。
当我测试你的标记时,我无法在Inbox中生成任何内容,但是,当我更改 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>
&#13;
你应该得到以下结果,你也会注意到它下面的第二个通知(巴塞罗那到马德里):