File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Client-Side Components/UI Actions/Email Watermark Utility Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 1+ function onClick(g_form) {
2+ var separator = "\n--------------------------------\n";
3+ var email_body = "Record URL:\n" + g_form.getDisplayValue('number') + separator;
4+ email_body += "Short Description:\n" + g_form.getValue('short_description') + separator;
5+ email_body += "Description:\n" + g_form.getValue('description') + separator;
6+
7+ var email_data = {};
8+ email_data.REQUESTOR_ID = g_form.getValue('caller_id') || g_form.getValue('opened_by') || g_form.getValue('requested_for');
9+ email_data.TITLE = g_form.getValue('short_description') || 'ServiceNow Communication';
10+ email_data.BODY = email_body;
11+ email_data.REQUEST_ID = g_form.getUniqueValue();
12+ email_data.TABLE_ID = g_form.getTableName();
13+
14+ var ga = new GlideAjax('GenericEmailUtility');
15+ ga.addParam('sysparm_name', 'get_Outlook_link');
16+ ga.addParam('sysparm_email_body', JSON.stringify(email_data));
17+ ga.getXMLAnswer(function(response) {
18+ var mailto_link = response;
19+ if (mailto_link && mailto_link != 'false') {
20+ window.open(mailto_link);
21+ } else {
22+ g_form.addErrorMessage('Unable to generate Outlook link.');
23+ }
24+ });
25+ }
You can’t perform that action at this time.
0 commit comments