The CreatorCon Call for Content is officially open! Get started here.

Preview Email from Form

MC_Soria
Kilo Expert

Good day all,

I have a business requirement to place the existing "Preview HTML body" UI action from a form as a button. I have created a "communication" table to support a process whereby ITIL workers can request a system outage communication to be sent to key stakeholders after a short approval process. One of the requirements I have is that the requestor and approvers be able to preview the email from the table form. I have two ideas on how to possibly implement this but cannot get either to work:

1. Click UI Action button or email client icon> Launch email client with "Send" button hidden - this has close to the desired effect in that it will show a pop-up with the template populated with the current information from the dbase - but we do not want to send using this, because we want to control when the message is actually sent. How would you hide the Send button?

2. Click UI Action button> trigger the "Preview HTML body" action - when I inserted this action into the communication form, it throws an error "email not found: " - I surmise because the script is intended to run off the sys_email table and is keyed to a specific email event. Can we tweak this script to pull the current sys id an populate?

Any ideas on to make these work or any new ideas would be greatly appreciated. Thank you.

10 REPLIES 10

mwascak
Kilo Contributor

Mario,
I've gotten this to work through a slightly different process. I've added a UI Action button on the form that when certain conditions are met (i.e. Priority 1, etc) a 'Send Email' is shown.

When this button is clicked it throws a pop-up which contains the exact information that will go out in the email notification. There is also verbiage that states "By clicking OK you are attesting to the information that is going out in this email, please hit cancel if changes need to be made." The pop-up itself is made of HTML is virtually identical to the email that gets sent out.

Once the user hits the OK button an event on the UI action kicks off the email notification and populates the email notification based on the pre-filled fields on the incident form.


I will give it a try. Thank you for your suggestion.


Hi mwascak,



We just started developing our Service Now and we have this similar business requirement. Would you mind sharing the steps and scripts you used to setup this?


Hi Edgar



Just wondering did you ever get this working, I have the same requirement and would appreciate any advice