Creating Send Email UI Action on Service Portal Page with option to Preview before Send

sureshhegde
Kilo Contributor

We are trying to create a Send Email custom UI Action on one of our Service Portal page similar Send Email from the backend on any of the form/ticket. We are also looking for ability to preview the email before clicking Submit. So, was looking if anyone here has any recommendation or suggestions for the same, as I wasn't able to find anything on the community.

Looking for the response.

Thanks,

Ashwath

1 ACCEPTED SOLUTION

Manish Vinayak1
Tera Guru

Hi Ashwath,

The email preview functionality uses the following URL in the background to generate the email preview:

https://<your-instance-name>.service-now.com/notification_preview_html_body.do?sysparm_record_id=<record_sys_id>&sysparm_user_id=<logged_in_user_id>&sysparm_event_id=&sysparm_notification_id=<notification_sys_id>

 

where record_sys_id is the sys_id of the record for which you want to preview the notification,

logged_in_user_id is the sys_id of the logged in user,

notification_sys_id is the sys_id of the notification record that you have configured for that record

 

You can use that URL, as a link in a widget which opens the preview in a new tab. Or you can try to create iFrame inside your widget, to show that page which renders the notification.

 

Here's an article I had written to have a UI Action on any table record (not on a service portal though) to preview notification before sending it. It uses UI page as a solution, you can try to convert the logic to a widget.

https://community.servicenow.com/community?id=community_article&sys_id=b1ba0acddbc7f708d82ffb2439961...

 

Hope this helps!

Cheers,

Manish

View solution in original post

7 REPLIES 7

Tony Chatfield1
Kilo Patron

Hi,

If you are refering to the compose email UI\popup?
Perhaps you can just invoke the existing email client from the service portal either as a popup or as a iframe
Looking at the way the email_client (popup) URL is formed, I don't think it would be diffuclt to recreate.

Thanks for the suggestion. But, is there a way that I can preview before sending, as the email client doesn't have the option to.

Manish Vinayak1
Tera Guru

Hi Ashwath,

The email preview functionality uses the following URL in the background to generate the email preview:

https://<your-instance-name>.service-now.com/notification_preview_html_body.do?sysparm_record_id=<record_sys_id>&sysparm_user_id=<logged_in_user_id>&sysparm_event_id=&sysparm_notification_id=<notification_sys_id>

 

where record_sys_id is the sys_id of the record for which you want to preview the notification,

logged_in_user_id is the sys_id of the logged in user,

notification_sys_id is the sys_id of the notification record that you have configured for that record

 

You can use that URL, as a link in a widget which opens the preview in a new tab. Or you can try to create iFrame inside your widget, to show that page which renders the notification.

 

Here's an article I had written to have a UI Action on any table record (not on a service portal though) to preview notification before sending it. It uses UI page as a solution, you can try to convert the logic to a widget.

https://community.servicenow.com/community?id=community_article&sys_id=b1ba0acddbc7f708d82ffb2439961...

 

Hope this helps!

Cheers,

Manish

wow, Thanks a lot Manish. I will take a look at this and will give a try.

 

Thanks,

Ashwath