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

David Stutter
Tera Guru

I made something similar.



First I created an own UI Page which contains the Email Preview: <g:inline template="notification_display.xml"/>.


With buttons "Send"/"Cancel" which will trigger the event for sending the email.


Simple Ajax call for gs.eventQueue(..).



The UI Action Button opens the UI Page and set the following preferences for the email preview:


.setPreference('sysparm_notification_id', [notification_sys_id]);


.setPreference('sysparm_target_id', [target_sys_id] );


Hi David,



Can you please share the details of your UI Page?


Hi Edgar,

Did you ever found a solution for this. Please let me know since i'm also facing the same problem.

 

Thanks,

Niranjan.

Hi dastu.

 

I have tried what you mentioned above bbut it isn't taking the target sys_id of the record. It  is randamly taking the record and the gives the information of that record. Can you please let me know how to pass the record to the notification preview so that it grabs the information from that record and shows.

 

Thanks,

Niranjan.

Hi,

 

I have a similar requirement. Were you able to figure out how to pass the current record to the notification preview?

 

Thanks,

Nayanthara