Email Bot - Get email message id , move emails to folder

We are using email bot with Microsoft Graph. Since Pega doesnt have capability to move processed messages to a different folder, we are looking to build an API integration using microsoft graph apis to move message to another folder. Graph requires email message id to identify the mail and move it. Is there anywhere Pega persists the email message id. I couldnt find it in the Email Triage (ET) case. Appreciate any inputs or alternate thought process or solutions. Goal is to keep processed emails separately so that it helps troubleshooting if any emails are not processed or made read ; but not processed etc.

@BibinMichael

@guptr2 @cherl any idea?

@BibinMichael ,

Isn’t ‘Forward unprocessed messages’ option on email listener addressing your goal?
When you enable this option, you will be prompted to enter an email address to which all the unprocessed emails would be forwarded.

@cherl , @VikasRaidhan , Thanks for looking into this question. Appreciate your help.

‘Forward unprocessed messages’ didnt help in all scenarios. We have encountered situations where Email Listener just marked messages read; but didnt really process it. There were also situations were email bot processed emails; but failed half way through while creating Email Triage cases.
Regardless it would be beneficial to add an optional capability to Archive processed messages (move from Inbox to some other folder) so that Inbox would only have unread messages or unprocessed messages. I would like to suggest this an enhancement to Pega email bot capability with Microsoft Graph.
We were able to achieve email archive capability by following below steps.

  • Capture Internet Message ID (Message-ID) by mapping it in Service-Email
  • Create a recurring Job in Job scheduler.
  • Job scheduler activity will use Graph API to list all read messages (API gives flexibility in terms of query criteria, sort, filter only relevant fields and limit number of messages to be retrieved.
  • For each read email, Pega to check if the message was processed and corresponding info exists in application. if it exists, call Graph API to move message to archive folder

@BibinMichael I appreciate your response and the solution you posted sounds like a good approach.

@cherl shouldn’t this be happening already? Emails that result in case creation are always removed from Inbox and unread or failed emails remain in the Inbox.