Send link in Email
I have a requirement in my project to send a link in an email to Business User. On click of that link, the user should be directed to the home page of his Portal. This is an Intranet application and Business User will be in the corporate domain for accessing the email and application. I don't think Directed Web Access feature is required.
I tried building the URL using a function as shown below
PublicAPI tools = null;
PRThread thisThread = (PRThread)ThreadContainer.get();
if (thisThread != null) {
tools = thisThread.getPublicAPI();
}
ClipboardPage requestorPage = tools.findPage("pxRequestor");
String reqContextURI = requestorPage.getString("pxReqContextURI");
ClipboardPage threadPage = tools.findPage("pxThread");
String reqServletName = threadPage.getString("pxReqServletName");
String querySubString = "?pyActivity=Embed-PortalLayout.RedirectAndRun&ThreadName=OpenPortal&Location=pyActivity%3DData-Portal.ShowSelectedPortal%26portal%3D"+portalName+"%2526Name%253D%2520"+harnessName+"%26pzSkinName%3D%26developer%3Dfalse%26ThreadName%3DOpenPortal&bPurgeTargetThread=true";
String linkURL = "<a href='"+reqContextURI+reqServletName+pega_rules_utilities.encodeURLParameter(querySubString)+"'>"+linkText+"</a>";
return linkURL;
Note: portalName and harnessName are passed as input parameters to the function for including in the URL.
The function returns the complete URL. While tracing, what ever URL the above function is returned, if I try to open in IE, it is opening the Developer portal instead of User Portal.
It seems threadPage.getString("pxReqServletName"); is not giving the User Portal path.
Please let me know how to fix this (or) If there is any better approach for this requirement.
Thanks
Vinay