diff --git a/Client-Side Components/UI Pages/Send Email On Form Incident/Email Preview.png b/Client-Side Components/UI Pages/Send Email On Form Incident/Email Preview.png new file mode 100644 index 0000000000..fc71d213fe Binary files /dev/null and b/Client-Side Components/UI Pages/Send Email On Form Incident/Email Preview.png differ diff --git a/Client-Side Components/UI Pages/Send Email On Form Incident/EmailScript.js b/Client-Side Components/UI Pages/Send Email On Form Incident/EmailScript.js new file mode 100644 index 0000000000..7890cfcd32 --- /dev/null +++ b/Client-Side Components/UI Pages/Send Email On Form Incident/EmailScript.js @@ -0,0 +1,19 @@ +// Email is been used to set the cc and subjed where we got from the UI Page and this will be attached to the Notification to run dymanically + + +(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template, + /* Optional EmailOutbound */ + email, /* Optional GlideRecord */ email_action, + /* Optional GlideRecord */ + event) { + + + // In this we get the data in the 4th parameter so that we use the parm2 to get the object of data and the used in the certain purpose + + var obj = JSON.parse(event.parm2); + email.addAddress("cc", obj.cc); + email.setSubject(obj.subject); + + template.print("
Details are :
" + obj.body); + +})(current, template, email, email_action, event); \ No newline at end of file diff --git a/Client-Side Components/UI Pages/Send Email On Form Incident/Event Registry.png b/Client-Side Components/UI Pages/Send Email On Form Incident/Event Registry.png new file mode 100644 index 0000000000..25379f8bff Binary files /dev/null and b/Client-Side Components/UI Pages/Send Email On Form Incident/Event Registry.png differ diff --git a/Client-Side Components/UI Pages/Send Email On Form Incident/Notification.js b/Client-Side Components/UI Pages/Send Email On Form Incident/Notification.js new file mode 100644 index 0000000000..ac5b15c10b --- /dev/null +++ b/Client-Side Components/UI Pages/Send Email On Form Incident/Notification.js @@ -0,0 +1,22 @@ +/* +Notificaiton for this proble + +Table : Incident (incident) + +When to Send +Send when - Event is fried +Event name - SendEamilInForm + +Who will receive +Event parm 1 contains recipient - True + +What it will contain +// This will hold the email script which we use to populate the subjec and the body. +Message HTML - ${mail_script:IncidentFormScript} +Email template - Unsubscribe and Preferences +Content type - HTML only + +*/ + +// Name of the Email Script will be populated when the notification has been triggered. +${mail_script:IncidentFormScript} \ No newline at end of file diff --git a/Client-Side Components/UI Pages/Send Email On Form Incident/Notification1.png b/Client-Side Components/UI Pages/Send Email On Form Incident/Notification1.png new file mode 100644 index 0000000000..ddd8d64ca5 Binary files /dev/null and b/Client-Side Components/UI Pages/Send Email On Form Incident/Notification1.png differ diff --git a/Client-Side Components/UI Pages/Send Email On Form Incident/Notification_Contains.png b/Client-Side Components/UI Pages/Send Email On Form Incident/Notification_Contains.png new file mode 100644 index 0000000000..f7aae33704 Binary files /dev/null and b/Client-Side Components/UI Pages/Send Email On Form Incident/Notification_Contains.png differ diff --git a/Client-Side Components/UI Pages/Send Email On Form Incident/Notification_Receive.png b/Client-Side Components/UI Pages/Send Email On Form Incident/Notification_Receive.png new file mode 100644 index 0000000000..de6f324897 Binary files /dev/null and b/Client-Side Components/UI Pages/Send Email On Form Incident/Notification_Receive.png differ diff --git a/Client-Side Components/UI Pages/Send Email On Form Incident/Readme.md b/Client-Side Components/UI Pages/Send Email On Form Incident/Readme.md new file mode 100644 index 0000000000..1495b7496c --- /dev/null +++ b/Client-Side Components/UI Pages/Send Email On Form Incident/Readme.md @@ -0,0 +1,25 @@ +Send Email On Form for every Record + +Script Type: UI Action, Table: incident, Form button: True, Client: True, Show update: True, OnClick: functionName() + +Script Type: UI Page Category: General + +Script Type: Email Script + +Event Registry : Table: incident, Fired by: UI Page, Event Name: SendEmailInForm + +Notification : Table: incident, Type: EMAIL, Category: Uncategorized, + +Goal: To Send Email on Form Directly by population some field and then customize the body and trigger it. + +Walk through of code: So to send the Email directly on each and every record there will be a UI Action which will help to populate the UI Page which we use some field to be populate in the UI Page directly to the particulat HTML content and these are the fields will be populate (Caller Email as the To and then Short Description as the Subjet of the Email) and othe field will be CC and Body which the user want to decide what data can be filled out and then send. + +UI Page - This will have 5 components +1. To Caller +2. CC +3. Subject +4. Body +5. Send button + +Once the Send button has been triggered this will call the Processing Script where the event will trigger once this will call the Event Registry event("SendEmailInForm") which we use for this problem statment.Where the Notification will trigger when the Event is fried and then for the email content we uset the Email Script which dynamic content will be populated which we got from the UI page as the event parm2 and then will send the email to the respective caller. + diff --git a/Client-Side Components/UI Pages/Send Email On Form Incident/UI Page Email template.png b/Client-Side Components/UI Pages/Send Email On Form Incident/UI Page Email template.png new file mode 100644 index 0000000000..ff09b940c5 Binary files /dev/null and b/Client-Side Components/UI Pages/Send Email On Form Incident/UI Page Email template.png differ diff --git a/Client-Side Components/UI Pages/Send Email On Form Incident/UIAction.js b/Client-Side Components/UI Pages/Send Email On Form Incident/UIAction.js new file mode 100644 index 0000000000..709e766e23 --- /dev/null +++ b/Client-Side Components/UI Pages/Send Email On Form Incident/UIAction.js @@ -0,0 +1,18 @@ +// This function will creat the model object and then route to the UI page which we configured to show the field details to fill by the user + +/* +Table- Incident (incident) +Form button - True +Client -True +Show Update - True +Onclick - Function name (sendEmail) + + + +*/ + function sendEmail(){ + var modalT = new GlideModal("SendEmailEvent", false, 1200); + modalT.setTitle("Send Email"); + modalT.setPreference("sysparm_sys_id", g_form.getUniqueValue()); + modalT.render(); + } \ No newline at end of file diff --git a/Client-Side Components/UI Pages/Send Email On Form Incident/UIAction_INC_fomr.png b/Client-Side Components/UI Pages/Send Email On Form Incident/UIAction_INC_fomr.png new file mode 100644 index 0000000000..e22daed2b6 Binary files /dev/null and b/Client-Side Components/UI Pages/Send Email On Form Incident/UIAction_INC_fomr.png differ diff --git a/Client-Side Components/UI Pages/Send Email On Form Incident/UIPage_Html.html b/Client-Side Components/UI Pages/Send Email On Form Incident/UIPage_Html.html new file mode 100644 index 0000000000..2d47ac6adc --- /dev/null +++ b/Client-Side Components/UI Pages/Send Email On Form Incident/UIPage_Html.html @@ -0,0 +1,109 @@ + +