- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2025 12:17 AM
Hi everyone,
I got one requirement where I have to create "print" button inside email body of the notification which should print the whole email content along with template whenever user click on that.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2025 05:26 AM - edited 07-23-2025 05:27 AM
You can modify the OOB UI Action "Preview email"
https://[yourinstance].service-now.com/sys_ui_action.do?sys_id=3f018430c0a8006f003b8fe60ba935cf
It calls a ui page where you can modify the html code to print the iframe
https://[yourinstance].service-now.com/sys_ui_page.do?sys_id=3f0dfc2ec0a8006f00955ada093e4bf2
<a href="#" onclick="printBGReport();" align="right">Print Email</a> <br />
<div id="email_preview">
<iframe src='/preview_email_body.do?sysparm_email_sys_id=${sysparm_id}&sysparm_translation=${sysparm_translation}&sysparm_direct=true&sysparm_stack=no' id='email_preview_iframe' width='100%' overflow-y='hidden' overflow-x='auto' frameborder='0' title="${gs.getMessage('Preview Email')}" style="background-color: white" />
<script>
function printBGReport() {
window.frames["email_preview_iframe"].focus();
window.frames["email_preview_iframe"].contentWindow.print();
}
</script>
</div>
PS: Duplicate the ui action and ui page for any modifications.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2025 05:26 AM - edited 07-23-2025 05:27 AM
You can modify the OOB UI Action "Preview email"
https://[yourinstance].service-now.com/sys_ui_action.do?sys_id=3f018430c0a8006f003b8fe60ba935cf
It calls a ui page where you can modify the html code to print the iframe
https://[yourinstance].service-now.com/sys_ui_page.do?sys_id=3f0dfc2ec0a8006f00955ada093e4bf2
<a href="#" onclick="printBGReport();" align="right">Print Email</a> <br />
<div id="email_preview">
<iframe src='/preview_email_body.do?sysparm_email_sys_id=${sysparm_id}&sysparm_translation=${sysparm_translation}&sysparm_direct=true&sysparm_stack=no' id='email_preview_iframe' width='100%' overflow-y='hidden' overflow-x='auto' frameborder='0' title="${gs.getMessage('Preview Email')}" style="background-color: white" />
<script>
function printBGReport() {
window.frames["email_preview_iframe"].focus();
window.frames["email_preview_iframe"].contentWindow.print();
}
</script>
</div>
PS: Duplicate the ui action and ui page for any modifications.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2025 06:02 AM
Thanks a lot pranesh..it works