Is there a way to automatically forward an email that has not been processed?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2024 07:18 AM
For one of my customers, a lot of users end up being deactivated incorrectly and when they send an email it does not get processed because they're not active. Is there a way to create a flow where this email would be automatically forwarded to the Service Desk so they would be able to forward themselves to ServiceNow and thus process it?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2024 10:24 AM
So I've attempted to do something similar and will admit that I had mixed results for various reason, but the short answer is that there is not an existing feature that you could utilize. All of the standard inbound email processing will stop once the email address resolves to a user that is locked out.
At a high level, a potential solution would look like the following.
Create a BR on sys_email, after update, where type changes to received-ignored and target is empty.
In the script you would:
Check if the user_id resolves to a user that is locked out
(if there is no user, or it's not locked out, just return).
Initialize a new record on sys_email
Set the type to send-ready
Set the notification type to SMTP
Set the recipients to be the email address you want to "forward" to.
Copy the current values for subject, body, content-type and headers to the new sys_email.
Insert.
Basically you are trying to identify emails that were ignored due to your specific use-case and then generating an outbound email record to your desired recipients.
Michael D. Jones
Proud member of the GlideFast Consulting Team!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2024 03:49 AM
Hi Michael, you mean active = false instead of locked-out here, correct? Would it still work the same if the user is only inactive?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2024 06:13 AM
Yes, sorry, the same concept would apply just change your script to check whether the user is inactive.
Michael D. Jones
Proud member of the GlideFast Consulting Team!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2024 10:46 AM - edited ‎01-05-2024 10:48 AM
Assuming the users deactivated incorrectly are going to be activated again at some point of time. Having a BR on sys_user table can be taken into consideration. If so, it would be something like this. You may also consider "Reprocessing the email" instead of again forwarding.
- When active changes to true
- Check the "Update"
- Advanced Script - Observe the UI Action called "Reprocess received emails" which creates an event to read the email and process again. You may loop through all "received-ignored" emails and generate an event.
Thanks,
Narsing