email script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2024 07:58 PM
Hi Team ,
can anyone please help me in the , mail script
I want print for a specific catalog item variables in the notification .
i have written mail script for this
Please correct if there is any mistake in notification configuration
Preview is showing like this
Catalog Item variables
OUTPUT has to come like this
SUB :- Short desciption
Body
"A lost or stolen device has been reported by" <Requested For>
The device was lost or stolen on <Date item was Lost/Stolen>
[Blank Line]
"Description:"
<Description>
can anyone please help me here .
what was the mistake .
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2024 09:46 PM
I am confused here , could you please help me here , complete script .... please provide script to me
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2024 10:07 PM
The notification email script:
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
var requester = current.requested_for.getDisplayValue();
var date = current.variables.date_item_was_stolen.getDisplayValue();
email.setSubject(current.short_description);
template.print("<p>A lost or stolen device has been reported by " + requester);
template.print("<p>The device was lost or stolen on " + date);
template.print("<br />");
template.print("Description:" + current.description);
})(current, template, email, email_action, event);
Mark this as Helpful / Accept the Solution if this clears your issue
Mark this as Helpful / Accept the Solution if this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2024 10:24 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2024 11:04 PM
Try the updated code:
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
var requester = current.requested_for.getDisplayValue();
var date = current.variables.date_item_was_lost_stolen.getDisplayValue();
email.setSubject(current.variables.short_description_1);
template.print("<p>A lost or stolen device has been reported by " + requester);
template.print("<p>The device was lost or stolen on " + date);
template.print("<br />");
template.print("Description:" + current.variables.description_1);
})(current, template, email, email_action, event);
Mark this as Helpful / Accept the Solution if this clears your issue
Mark this as Helpful / Accept the Solution if this helps.