- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 09-06-2022 06:42 AM
If you have multiple email accounts and receive an email that has been sent blind-copied (BCC) it is impossible to know which account the email was sent to. As set out in this KB:
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0820647
ServiceNow only supports conditions on the To: and CC: addresses. Even though ServiceNow implicitly knows which account is being read from this is not made available and because the Email reader is in Java we have no means to fix it ... but there is a workaround if you use OAuth to authenticate.
If you're using OAuth to authenticate your email accounts (via IMAP or new MS Graph), the email reader accesses the token record for each account before reading from it. We can use a Query business rule to note which account the process is accessing in order to tag the resulting email records with which account the email was read from.
OAuth Token Business Rule
| Field | Value |
| Name | Capture email account |
| Table | oauth_credential |
| Advanced | [X] |
| When | before |
| Insert | [ ] |
| Update | [ ] |
| Delete | [ ] |
| Query | [X] |
| Condition |
|
| Script |
|
Email Business Rule
| Field | Name |
| Name | Populate BCC from account |
| Table | sys_email |
| Advanced | [X] |
| When | before |
| Filter Conditions | Type is received |
| Insert | [X] |
| Update | [ ] |
| Delete | [ ] |
| Query | [ ] |
| Condition |
|
| Script |
|
Inbound Action
You can then use a condition in an Inbound Action like Blind copied contains bugs@acme.com. The address is the user name from your email account.
- 2,142 Views
