How do I allow an inbound email to update a case if email is not in a User record?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2019 08:56 AM
We have Users who have several email address in our Company but only one email address in their User record. We have an Inbound Action to 'Update HR Case' when they reply to a Service-Now email. If they are replying FROM their other email address not in User record it rejects their email and will not update the Target.
How can I remove/ignore that validation but still allow the other criteria that will match the inbound action to an HR Case? I have seen references to the guest.user but am unsure where to find the original 'action' it is validating against that ties the User to the email address.
- Labels:
-
Instance Configuration

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2019 09:04 AM
There's not an easy solution to this. You should write something that looks for the email, and if it isn't found, search for the name and try and add it as a secondary email. However, this will get incredibly complicated if they don't have similar emails, such as firstnamelastname or lastnamefirstname + @anydomain or +@example.example.domain. You should probably review the process for that first and try and get them to reply with their email address registered in the system.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2019 09:22 AM
We have asked that they reply via their primary (system) email address but as a group of Academic Medical Centers people are often using their 'other' email address regularly so they reply from that address like @Harvard.edu. How to do you add as a secondary email address?
Would it be possible to have a list of accepted @xyz.domain address?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2019 10:07 AM
So I would write something like this.
vvv
function emailUsername(emailAddress) {
return emailAddress.match(/^(.+)@/)[1];
}
var emailUser = emailUsername(email.origemail);
var findUsers = new GlideRecord('sys_user');
findUsers.addEncodedQuery('nameLIKE' + emailUser); // search for a name like the beginning of the email
findUser.setLimit(1); // prevents duplicates, if these already not removed from the system
findUser.query();
if(findUser.next()){
findUser.secondaryEmailAddress = email.origemail; // updates the sys user record with the secondary email address
findUser.update();
}
// continue to UpdateHRCase
I would test this as I did not when I wrote it. But this is the general concept of what you need to do. You may also need to create another field on the sys_user table called secondary email address or your preferred name.