Notifications

23 views

Description

In some cases there maybe a need to add a custom header to emails generated from ServiceNow platform. This can be achieved via business rules.

Instructions

To add custom header, do the following:

  1. Create a business rule on the sys_email table ("on before", "insert/update")   
  2. The script is below. It is important to put your headers BEFORE ServiceNow headers.
    If you simply append your headers, they will be cut off.

    /* add headers */

    if(current.headers.indexOf("X-My-Header-Here") < 0){
           current.headers = "X-My-Header-Here: " + headerValue + "\n" + current.headers;
    }

Article Information

Last Updated:2019-09-30 14:55:41
Published:2019-09-30