diff --git a/Mail Scripts/Added a case/content b/Mail Scripts/Added a case/content new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/Mail Scripts/Added a case/content @@ -0,0 +1 @@ + diff --git a/Mail Scripts/Case details/Case details notification.js b/Mail Scripts/Case details/Case details notification.js new file mode 100644 index 0000000000..24b3f69c30 --- /dev/null +++ b/Mail Scripts/Case details/Case details notification.js @@ -0,0 +1,81 @@ +(function runMailScript(current, email, email_action, event) { + // Store frequently used `current` values in variables to avoid multiple calls + var caseSysId = current.getValue('sys_id'); + var caseNumber = current.getValue('number'); + var caseLink = '' + caseNumber + ''; + + // Retrieve the first name from the event parameter, defaulting to "Team" if missing + var firstName = event.parm2 || "Team"; + + // Top banner HTML + var banner = + '
'; + + // Initialize email body with banner + var emailBody = banner + + 'Hello ' + firstName + ',
' +
+ 'You have been added to case ' + caseLink + '\'s watch list. Click the link to view the case details.
Description: | '; + emailBody += '' + gr.getValue('description') + ' |
Location: | '; + emailBody += '' + gr.getDisplayValue('location') + ' |
Images: | '; + emailBody += '';
+
+ while (attachmentGr.next()) {
+ var attachmentLink = gs.getProperty('glide.servlet.uri') + 'sys_attachment.do?sys_id=' + attachmentGr.getValue('sys_id');
+ var fileName = attachmentGr.getValue('file_name');
+
+ // Display image if applicable, otherwise show a link
+ if (attachmentGr.getValue('content_type').startsWith('image/')) {
+ emailBody += ' |
No attachments found for this case. | |
No matching case details found. |
Best regards,
(name)