Email Notifications Character Limit Limitation

Joel14
Kilo Contributor

Hi everyone. I've been trying to setup a notification email for one of the catalog items. The problem that I am encountering is that the email message is truncated. I believe this is caused by a character limit restriction. The form is roughly 3.2k characters and it can get as big as 7k characters when it's filled. I tried playing with glide.email.outbound.max_body_bytes and com.glide.email.max_body_bytes to change the size, but even then, the message gets truncated in the same place. I also made sure that their sum is nowhere close to the maximum. Is there anything that I am missing ? The goal is to email the entire request form to a distribution list. An alternate way would be converting that form into an attachment and emailing it but I have no idea how to do that either. Any help would be appreciated.

7 REPLIES 7

Deepak Ingale1
Mega Sage

Hi,

 

https://docs.servicenow.com/bundle/london-servicenow-platform/page/administer/notification/reference/r_EmailBodySizeLimitProperties.html

 

Please see first you are getting a message that body is truncated in by ServiceNow or at email client or email server?

 

When it gets truncated at ServiceNow end, we see error message as documented below.

 

Creating a attachment is possible, but its time consuming. There is PDF file generator plugin which ServiceNow provides, it comes with HR management pack ( not sure about new scoped app of HRSD though ). However, that PDF generation also requires a lot of work to be done.

 

find_real_file.png

rahulpandey
Kilo Sage

Hi, Below code would generate the form PDF and attach to itself.

Put this into a UI action

var attachment = new sn_ws.RESTMessageV2();
attachment.setHttpMethod('GET');
var url = gs.getProperty("glide.servlet.uri") + current.getTableName()+ '.do?PDF&sys_id=' + current.sys_id;
attachment.setEndpoint(url);       attachment.setBasicAuth(gs.getProperty('glide.user.userid'), gs.getProperty('glide.user.password'));     attachment.saveResponseBodyAsAttachment(current.getTableName(), current.sys_id,current.number+".pdf");
var response = attachment.execute();

 

Create an event in registry.

In same UI action, you can use gs.eventQueue to fire an event and, create an email notification and check include attachment.

Hi, Edited the post

Great !!!, Thank you for reminding this 😉