Show multiple hyperlinks in an email notification using email script
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2023 05:45 AM - edited 10-31-2023 08:47 AM
Hi all,
I have a requirement where the due hr tasks are shown to a specific user via email notification. The links to the tasks need to be displayed in email notification line wise.
This is the script that i tried. I want to push the links into array and show it in the email, can someone give me a lead on how to proceed? I am blocked.
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
//cur_date refers to Current date
var cur_date = new Date().toISOString().split('T')[0];
var incLink = '';
var e_s_date = current.parent.ref_sn_hr_core_case.subject_person_hr_profile.employment_start_date;
//e_s_date refers to employment start date
if (e_s_date <= cur_date) {
if (current.parent.hr_service.name != "Onboarding") {
incLink = 'env?id=hrm_ticket_page&table=sn_hr_core_case&sys_id=' + current.parent.parent.sys_id;
} else {
incLink = 'env?id=hrm_ticket_page&table=sn_hr_core_case&sys_id=' + current.parent.sys_id;
}
} else {
if (current.parent.hr_service.name != "Onboarding") {
incLink = 'env?id=hrm_ticket_page&table=sn_hr_core_case&sys_id=' + current.parent.parent.sys_id;
} else {
incLink = 'env?id=hrm_ticket_page&table=sn_hr_core_case&sys_id=' + current.parent.sys_id;
}
}
template.print('incLink');
})(current, template, email, email_action, event);
Thank you in advance!!