Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Sending a clickable link with the Email Navigation Add-on link

jmuomini
Mega Expert

Hi,

I'm trying to customize an email client template for kb_knowledge to send a clickable link with the Email navigation link from kb_home. I've tried ${URI} and ${URI_REF}, but these put in long, ugly URLs that aren't clickable. I've also added a URL calculation field to my kb_knowledge form, but when I put this field on my template with


<a href="${u_url}" target="_blank">${number}</a>

the emailed link is truncated to:


<a href="/kb_view.do?sysparm_article=KB10090" target="_blank">KB10090</a>.

If I then add the missing part of the URL:


<a href="https://usfdev.service-now${u_url}" target="_blank">${number}</a>


I end up with duplication:


<a href="https://usfdev.service-nowhttps//usfdev.service-now.com/kb_view.do?sysparm_article=KB10090" target="_blank">KB10090</a>


Any suggestions on how to get a simple clickable link from a KB article in an email client template?

Thanks, Jim
1 ACCEPTED SOLUTION

jmuomini
Mega Expert

Thanks to some deep digging by Sam Polk at the SNOW Help Desk with an assist from Cesar Sandoval, I have an answer at last to why my email URLs were being truncated and none on the rest of you were seeing this.

About a year ago I followed a tip to change the body field type on sys_email from String to HTML. This allows you to use the TinyMCE HTML editor in the email client. The unintended consequence is that full URLs links are changed to relative URL links during the process of changing the sys_email body text from plain text to HTML, according to Sam.

Thanks to Sam, Cesar and all who tried to help me.

Jim


View solution in original post

25 REPLIES 25

Hi breinhart,



It's not a property, it's the 'body' field type on the sys_email table. Change it from HTML to String. When I did this it resolved the URL problem, but made Quick Message Templates less friendly.



The long-term news is better. Eureka gives email an overhaul and when I mentioned this specific issue to a developer he was familiar with it and said it will be solved. Look for major improvements to email in Eureka.



Take care, Jim


Blair5
Tera Guru

Jim,



Thanks for the info. I see that we don't have that set in our 'client template' for tasks. I think I will open a ticket with Service now.



Thanks, Blair


If you want to give them our experience to look at as a reference, the ticket is INT2259446.



Jim


Blair5
Tera Guru

Great - that would be very helpful...Thanks!


dmartinc
Tera Expert

Dear Jim,



While having the same issue as you, I stumbled upon your post and then I found the good solution for me.


Indeed one correct answer is to not use the HTML editor at all by turning the body field into a String.



But if you want to keep the HTML editor, the "good" solution is to create the system property "glide.ui.html.editor.remove_host" with value="false".


Then, the HTML editor will stop turning links pointing to https://instance.service-now.com/ into relative links.



Source: KB0522473 / PRB580960 in /hi : ServiceNow Customer Service System



Cheers,


David