How to create dynamic hyperlink in notification so it can redirect to either portal or workspace

Veda3
Tera Contributor

How to create dynamic hyperlink in email notification so that it can redirect to either portal or workspace based on the user group 

5 REPLIES 5

Priyanka0402
Mega Sage
Mega Sage

Hello @Veda3 , 

You have to write a Email Script and later call that in Email notification for dynamic link using 

${mail_script:nameofthescript}. 
In Email Script Glide 'sys_user_grmember' table to check the group of the user and according to that you can create if else condition and write the code accordingly. 
For dynamic link you this 

 

taskUrl = '<a href="/asc?id=hrm_todos_page">Link</a>';   // use link of workspace or portal instead of asc?id=hrm_todos_page

// Create the email body with the task URL included
var emailBody = taskUrl ;

// Set the email body
template.print(emailBody);

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards

Priyanka



Hi @Priyanka0402,

How to go through all the recipients of the notification and send the notification accordingly

@Veda3

If you want to send to all the members of the user group, there are two ways to do it.

1. Create the notification and give the reference of the group name so that email will be send to all the members of the group

2. dynamically you can give the reference of the group name in the table 'sys_user_grmember' and modify your code the send the email with the link of the record,

 

to send the link

Link to related records (servicenow.com)

Please hit the thumb Icon and mark as correct in case I help you with your query!!!
- Kailas

How to send the notification if notification has multiple recipients like watchlist,caller and assignment group. I am able to send the dynamic notification if there is one user like caller or assignee. but how to send the notification if we have multiple recipients and also watchlist