I have to enable email preview on workspace

Nivetha23jay
Tera Contributor

Hi guys,

I have a requirement where I have to create preview mail option which will be showed under form menu of email tab that is available under service operations workspace, kindly let me know how to enable it

6 REPLIES 6

anand-bhosle
Tera Guru

@jennv Right. You can replace & add g_modal.open({...}), which is workspace friendly model API.

 

try this code & test.

 

(function previewEmail() {
// only run in the Workspace client
if (typeof g_modal !== 'undefined') {
g_modal.open({
title: 'Email Preview',
// name of your UI Page or widget that renders the email body
widget: 'email_preview',
widgetInput: {
sysparm_sys_id: current.sys_id
}
});
} else {
// fallback if someone somehow hits this in classic UI
var gm = new GlideModal('email_preview');
gm.setTitle('Email Preview');
gm.setSize('large');
gm.addParam('sysparm_sys_id', current.sys_id);
gm.render();
}
})();

 

 

  • widget should match your UI Page name (email_preview) or a Service Portal widget if you’re using one and widgetInput passes parameters into that page (your sysparm_sys_id).

 

Thank you!!