电子邮件标记不起作用 [英] Email markup not working

查看:104
本文介绍了电子邮件标记不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正尝试发送带有标记的航班确认电子邮件,以便在Gmail中突出显示航班信息.

I'm trying to send a Flight confirmation email with markups in order to get highlighted the flight information in 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会自动显示航班信息,但有时会显示一些错误信息.

When I don't include this markup in the email, gmail is showing flight info automatically, but sometimes there is some wrong info.

现在,当我包含标记时,该标记通过了 Google标记测试, Gmail不显示飞行精彩集锦".我已尝试使用我的个人帐户作为发送者和接收者来尝试此操作,以便忽略注册要求,就像我已阅读此处,但这不起作用.

Now, when I include the markup, that passes the Google Markup Test, Gmail doesn't show Flight Highlight. I have tried it with my personal account as sender and as recipient in order to ignore the registration requirements, like I have read here, but this is not working.

能给我一些指示吗?

推荐答案

您的 DateTime 格式不正确.根据文档:

Your DateTime formatting is not correct. Per the documentation:

(DateTime值应采用ISO 8601格式,例如'2013-02-14T13:15:03-08:00'(YYYY-MM-DDTHH:mm:ssZ).

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

When I tested your markup, I wasn't able to generate anything in Inbox, however, when I changed the departureTime and arrivalTime attributes in your markup, I was able to generate actions.

<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>

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

You should get the following result, you'll notice the 2nd notification (Barcelona to Madrid) below it as well:

这篇关于电子邮件标记不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆