Knowledge Article Email
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2015 05:11 PM
Trying to build mail script into client template that utilizes ${URI} and takes you to the user view of the kb article.
Have used the following in client template:row
<mail_script>
dothis();
function dothis() {
var servletUri = gs.getProperty('glide.servlet.uri');
template.print(servletUri + 'nav_to.do?uri=kb_view.do?sysparm_article=' + current.number + '\n');
}
</mail_script>
This works and gets me there. The email has the url, but I have found some browser email clients (Outlook Web Access in Safari) display it as string only and not hyper-link. In addition, if you are not logged into the instance and using IE, it loads the page and indicates you don't have permission to view the article.ove
<a href="${URI_REF}"><mail_script>template.print(current.number);</mail_script></a>
The above works, but takes you to the kb article but takes you to the record itself, not the user view of the kb article. Also using URI, will direct you to logon, if you are not already, and then directs you to the article. I have even tried adding sysparms to the URI to force it to a different view, but it still loads the record. I found that the user view under Knowledge Base | View is not the same as opening a KB article record in the kb_view form view.
<a href="${URI+&sysparm_view=kb_view}"><mail_script>template.print(current.number);</mail_script></a>
If I could combine (servletUri + 'nav_to.do?uri=kb_view.do?sysparm_article=' + current.number + '\n'); within <a href> I think that would do it, but have not found a way to make it work. Everything takes me to the kb article record and not the "user view" of the record.
To clarify, I have attached the knowledge record view and the knowledge user view (which is what I want to load)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2015 11:59 AM
Create a Mail script with the following code.
Title it: KBview
changeView();
function changeView() {
var servletUri = gs.getProperty('glide.servlet.uri');
template.print(servletUri + 'nav_to.do?uri=kb_view.do?sysparm_article=' + current.number + '\n');
}
in your email notification insert ${mail_script:KBview} Where you want to insert the link.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2016 01:48 PM
Steven,
I used your code and it works terrific so thank you! Is there a way to have it display the link as text like "click here" rather than put the entire URL path in the email?
Shane
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2016 02:09 PM
Ignore my last post. Here is the code if you or anyone needs it. Thank you for your original post. It is a great help!
changeView();
function changeView() {
var servletUri = gs.getProperty('glide.servlet.uri');
var link = "<a href='" + servletUri + 'nav_to.do?uri=kb_view.do?sysparm_article=' + num + "'>Click Here</a>";
template.print(link);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2016 06:23 PM
WOW, i forgot about this.
I actually edited my Code to insert the KB# as the clickable link.
changeView();
function changeView() {
var servletUri = gs.getProperty('glide.servlet.uri');
var link = servletUri + 'nav_to.do?uri=kb_view.do?sysparm_article=' + current.number;
template.print("<a href=" + link + ">" + current.number + "</a>");
// template.print(servletUri + 'nav_to.do?uri=kb_view.do?sysparm_article=' + current.number);
}
i haven't touched this script in forever. it's been working great.