I use Ruby on Rails to create email. As mentioned in the Email Markup Docs, I modified the templates (* .html.haml) to include a layout for email markup. Below is the code from my template:
%script{ type: "application/ld+json" } { "@context" : "http://schema.org", "@type" : "FoodEstablishmentReservation", "reservationNumber" : "#{reservation.id}", ... }
I also changed the sender and recipient of the email to the same email id as mentioned here to verify the schema in design mode.
When I receive an email in my Gmail inbox and I see nothing else. When I check the original email, it shows:
Return-Path: < breezebhoewal@gmail.com > ... Date: Wed, 21 Dec 2016 13:14:45 +0530 From: breezebhoewal@gmail.com To: breezebhoewal@gmail.com ... Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="--==_mimepart_585a32ecf2d94_143673fd10d24128893014"; charset=UTF-8 Content-Transfer-Encoding: 7bit ----==_mimepart_585a32ecf2d94_143673fd10d24128893014 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable ... <script type=3D'application/ld+json'> { "@context" : "http://schema.org", "@type" : "FoodEstablishmentReservation", "reservationNumber" : "<reservation-id>", ... } </script> ...
Now, if I check the contents of the <script> in the Email markup tester test, it says βno structured dataβ, but as soon as I remove the β3Dβ from the <script> and make it <script type='application/ld+json'> , it correctly extracts structured data for all fields.
So, I canβt understand why this extra β3Dβ line is being added to HTML? Is it because of Haml? or is gmail doing this? And is there anything that I can fix to test this email markup in a development environment. Let me know if additional information is needed.
source share