Inbound Email User Matching other than From Email

Tami Martin
Tera Contributor

While processing Inbound Actions, it is default behavior that ServiceNow parses the From email to identify the sender and then impersonates the sender to process the record created or updated (see Identifying the Sender and Email user matching). One advantage of impersonating the sender is the activity log is logged with the user impersonated.

We have two situations we would like to modify the impersonated user for an inbound email. In both cases, we are able to retrieve the correct user and update fields such as Opened By, Requested For, etc, but we have not found a way to impersonate user for processing the email in order to correctly have the activity log appear to be logged by the desired User (usually replacing Guest).  In other words to act as the User ID field of the email is populated verses the User field.

These use cases are:

  1. The From address on the email is an alias that we list as an Email type in the Notification Device of the User record.  In this case we match From address on the email to the Notification Device in order to find find the User that has a different address in the Email field of the User record.
  2. An application integration that lists the user in the body of the email (Ex. User:John Doe)

How can an email be processed to modify the Identified Sender?

3 REPLIES 3

Sumit Pandey1
Kilo Guru
Kilo Guru

Hi, Not sure if I understand your question but if you want to impersonate a particular user, in your inbound action you can use - 

var impUser = new GlideImpersonate();
impUser.impersonate("62826bf03710200044e0bfc8bcbe5df1");

Click here to read about GlideImpersonate()

Tami Martin
Tera Contributor

Submit Pandey,  Thank you for the response, but you did misunderstand, we are not trying to impersonate anyone, we are trying to use what is already part of email processing that impersonates users, just to impersonate a different user.

To give more background.  The email processing on ServiceNow determines the User that sent the email and enters that user in the User ID field in the Emails logs.  If that sender address for the inbound email is not in the Email field of any User record, the process assigns the Email to Guest and puts the sender address in the User field in the Emails logs.  After processing the email, the Inbound Actions are then processed with the system impersonating the User in the User ID field (or Guest if user is not found).

The question is during the initial processing of the emails when the system is trying to determine which User is the sender of the email, is it possible to add logic following the check of the sender address in the Email field of User records to then check if any User record has a Notification Device with that sender address?

Hi Tami,

 

Are you able to set it up?

Kamil