I am using Ruby on Rails to generate the email. As mentioned in the Email markup docs, i modified my (*.html.haml) templates to include the schema for Email markup. Below code is from my mailer template:
%script{ type: "application/ld+json" }
{
"@context" : "http://schema.org",
"@type" : "FoodEstablishmentReservation",
"reservationNumber" : "#{reservation.id}",
...
}
I also modified the sender and receiver of the email to the same email id as mentioned here for testing the schema in development mode.
When i receive the email in my Gmail inbox, and i don't see anything different from before. When i check the Original Message of the email, it shows:
Return-Path: <[email protected]>
...
Date: Wed, 21 Dec 2016 13:14:45 +0530
From: [email protected]
To: [email protected]
...
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 validate this <script>
tag content in the Email markup tester, it says "no structured data is present", but as soon as i remove "3D" from <script>
tag and make it <script type='application/ld+json'>
, it extracts the structured data correctly for all the fields.
So, i am unable to figure out why this extra string "3D" is being added to the HTML? Is it because of Haml? or Gmail does it? AND is there anything i can fix to test this Email markup in development environment. Let me know if more info is needed.
I had this same problem. It turns out I had a few misunderstandings which I will help clarify:
1) As pointed out above, the "Original Message" you saw in gmail was encoded as quoted-printable. You first have to decode the message, e.g. using Quoted Printable Converter, and the decoded message does not contain any 3Ds. The decoded message will then validate correctly (presumeably) using the Email Markup tester you referenced.
2) I arrived at this thread because I was debugging my integration using email markup. The markup wasn't showing in test emails and I thought I was implementing it incorrectly. I discovered my email schema integration must be whitelisted by Google to use these features.
I hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With