Gmail subject like "Go To Action" with JSON-LD and cfmail

196 views
Skip to first unread message

Greg Moser

unread,
Oct 7, 2014, 6:12:40 PM10/7/14
to ra...@googlegroups.com
I wanted to add some JSON-LD to emails that our application is sending out.  Basically it adds links directly in the subject line and it's how github recently added this feature a couple weeks back:


basically it takes advantage of gmail actions which can be read here:


If you actually look at the code in the email for a github pull request, you will see that it drops a script tag like this:

<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"View this Pull Request on GitHub","action":{"@type":"ViewAction","url":"https://github.com/ten24/Slatwall/pull/2479","name":"View Pull Request"}}</script>

However when I try to add a tag like this as part of my HTML body, it gets replaced with something that looks like this:

<invalidTag type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Notification From Slatwall","action":{"@type":"ViewAction","url":"http://www.gregmoser.com/","name":"Reset Password"}}</script>

You can see how 'script' got replaced with 'invalidTag'. Now I don't know if that is gmail stripping it out, and I need to pass it as a different mailpart, or if this is Railo stripping it out.

Any ideas would be much appreciated.

Thanks,
Greg

MrBuzzy

unread,
Oct 7, 2014, 6:39:45 PM10/7/14
to ra...@googlegroups.com
IF Railo has implemented global script protection similarly to ACF you could try turning that off, as a test;

--
Did you find this reply useful? Help the Railo community and add it to the Railo Server wiki at https://github.com/getrailo/railo/wiki
---
You received this message because you are subscribed to the Google Groups "Railo" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/railo/e95aa2e7-2c28-46b7-9bca-5adefc002c6b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages