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

geoffcox
Giga Guru

I couldn't quite tell if all that discussion answered the question.

Here's an example of an easy clickable, readable link in an outgoing service-now email template, in this case to open a record of the Issue Tracking table. The mail script is used to get the current instance name so that it works from prod as well as dev or qa.



<tr><td align="center">Link:<b><a href="https://<mail_script>template.print(gs.getProperty('instance_name'));</mail_script>.service-now.com/nav_to.do?uri=u_issue_tracking.do?sys_id=${sys_id}">${number}</a></td></tr>


I hope this helps.


I've had a log of good suggestions here, but they always end up with the instance removed. With your example I get:



<a href="/nav_to.do?uri=kb_view.do.do?sys_id=672497d05deb4140a24782e67221f7e1">KB10147</a>


I'm waiting for the help desk to respond to this.

Thanks Geoff.

Jim


One problem: .do appears twice in a row.
Otherwise, that looks great!
The result should be just the number "KB10147" that is a clickable link (but you shouldn't see the link info).


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


Jim,



I'm having the exact same issue. Where is this sys_email property set for HTML vs String?