How best to pull in emails from Outlook?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2022 12:36 PM
In our current state we have a Notes mailbox that receives emails from a fax service. The senders are users in our various stores around the country, and the fax is attached as a pdf. The email body contains the sender's fax number and the date sent:
Sent from: 5551212
Date: 01/10/2022
Our requirement was, and is, to:
(1) tag the email with the store number associated with the sender's fax number
(2) tag the email with the state -- for example South Carolina -- that store resides in
(3) Allow users to filter by state and date sent
The point of this is to allow the users to find the pdfs sent in from certain states within certain date ranges, without relying on OCR to attempt to pull this out of the pdf. So we need some tagging mechanism, and a user interface.
Our stores (that is, the senders) are already in the cmn_location table, with their fax numbers, so that was the obvious place to look for (1) and (2).
cmn_location
state TX
fax_phone 5551212
name STR123
So if I receive a fax from 5551212 I can determine that that came from store 123, in Texas.
I could have pulled the cmn_location data into Notes via REST, and tagged the emails there, but it would be very difficult to create a good, dynamic UI for this in Notes. So I wrote a script to push the emails into a custom ServiceNow table via REST, with the sender's fax number and date sent as params, and I use a business rule to look up the state and store number. That works fine, and allows me to use ServiceNow as the UI, taking care of (3).
But Notes is being shut off, and that mailbox will be migrated to Outlook (cloud). So I need to find another solution, and I've considered the following:
-- I thought of having ServiceNow make REST calls into Outlook, and pull in the records. I would need some way to walk through the records, for example to pull all records received between date X and date Y, and move the X/Y window forward each time. This sounds like it would work.
-- I also checked into using Power Automate to send the emails from Outlook to ServiceNow. This worked well enough, but didn't look very robust. I could not see a way to set up a re-send of all records, and there wasn't much in the way of exception handling.
-- Forwarding the emails into ServiceNow is of course not an option, becuase I do not know what busness rules will be written in the future, and the emails could get swallowed up by someone else's rule.
Is there another way to make ServiceNow aware of what emails have arrived in that one Outlook mailbox, and parse out the body and attachment?
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2022 01:25 PM
I don't quite understand why option 3 is not an option.
Quite simply, you set up an inbound action to deal with the forwarded email and do what you want with it. In the email headers there should be something like this:
Resent-From:<email_address_of_your_mailbox_where_you_forward_from>
Put a condition for header to contain this string to trigger the inbound action (or the flow if you use flow designer). This way you can only treat the emails from coming from your email address correctly and not mess up any other emails from other sources.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2022 02:15 PM
It's because six months hence Ted will set up an inbound action to process emails from vendor X, leave the condition too wide, set the order to 1, and check stop processing. The result will be that my rule never sees the inbound mail.