How to process emails in realtime

Hi,

I am trying to understand the best way to process the body of customer emails as soon as they’re received by Genesys (or as close to realtime as possible). The solution I’ve come up with is as follows:

  1. AWS EventBridge listens for the v2.detail.events.conversation.{id}.customer.start event and triggers a Lambda when an event has eventBody.mediaType == 'EMAIL'
  2. It uses the Conversation ID from the event to then call the /api/v2/conversations/{conversationId}/recordings endpoint to get the email body.
  3. The Lambda can then send the email body on to our 'Processor'.

Is there a better way of doing this, or if this is the best way are there considerations I should be aware of? Alternatively I can get the email body by calling:

  1. GET /api/v2/conversations/emails/{conversationId}/messages to get the message ID(s)
  2. GET /api/v2/conversations/emails/{conversationId}/messages/{messageId} to get the email body

Any advice would be greatly appreciated.

2 Likes

I thought I'd share what appears to be working, incase anyone else wonders how to do this in the future:

In the end I decided on listening for two events, to make sure I can capture all inbound and outbound emails as quickly as possible:

  • v2.detail.events.conversation.{id}.customer.start
    • Produced when an email is received by either a flow or a queue
  • v2.detail.events.conversation.{id}.customer.end
    • Produced after a flow/Auto-Reply or agent
1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.