Email markup-Gmail, modifying the <script> tag to add an additional "3D" line,

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.

+5
source share
1 answer

you can try adding this meta tag to the title

  <meta charset="charset=ISO-8859-1"/> 
0
source

Source: https://habr.com/ru/post/1261632/


All Articles