AWS Contact Center

Best practices for handling email messages within a flow

Providing efficient and effective customer service is essential for organizations, and email remains a critical communication channel. Email offers a flexible and familiar medium for customers to seek help and resolve issues. Despite the rise of newer communication methods like chat and social media, email’s asynchronous nature allows customers to engage at their own pace while providing organizations with a detailed history of interactions. However, as customer inquiries increase in volume, managing email support efficiently can become a challenge. Without a streamlined process for handling customer emails, organizations struggle to prioritize urgent matters, personalize responses, and identify sensitive information.

Automating email parsing and analysis can address these challenges, improving both customer experience and agent productivity. By implementing automated email processing solutions, organizations can efficiently manage and respond to customer inquiries, ensuring timely resolution of issues while maintaining a high level of personalization and adherence to data privacy regulations. Organizations can take appropriate actions based on the content, such as escalating important issues, sending automated responses, or avoid routing emails that don’t require a response, such as thank-you notes. Email analysis also allows for detecting intent, sentiment, keywords, and personally identifiable information (PII).

Amazon Connect announced the launch of capabilities that make it easy to handle email inquiries from the Amazon Connect Agent Workspace. In this blog post, we’ll look at how Amazon Connect enables customers to use Artificial Intelligence (AI) for intelligent email routing, meaningful customer insights, personalization, and email automation.

Time to read 4 minutes (874 words)
Services used Amazon Connect, Amazon SESAWS Lambda

Overview

Amazon Connect Email offers routing, queueing, and integration capabilities using the same Flow as other Amazon Connect Channels. Amazon Connect provides the StartEmailContact API to handle incoming emails. This API exposes basic email fields on the request object, which are used to populate email information and initiate an email contact within Amazon Connect. However, only email contact attributes like From, To, CC, and Subject are stored on the email contact itself. The email body content and attachments are stored on Amazon Simple Storage Service (S3).

See Set up email in Amazon Connect for more information on how the email contact information is populated into the email contact.

Email contact handling in Agent CCP

Handling email messages

You can retrieve email messages from Amazon S3 within Flows using AWS Lambda and analyze their contents using AI, machine learning (ML), or large language models (LLMs) like Amazon Bedrock.

When an end-customer sends an email to an email address set up in an Amazon Connect instance, the email is first processed by the Amazon Simple Email Service (SES). The Amazon SES service then invokes the StartEmailContact API. This API validates the request parameters. It also checks if at least one email address in the ‘To’ or ‘CC’ field is valid and exists within the Amazon Connect instance. If successful, it generates a contact ID and returns it in the API response. After this, an asynchronous workflow is triggered to process the email message further before starting the flow associated with the email address found in the Amazon Connect instance. Customers can access email metadata (From, To, CC, and subject) as flow attributes for routing decisions within a workflow. However, the email message content is stored in S3 as a reference.

Here is the recommended design on how to access, analyze and utilize an email message

  1. Create a Flow to handle incoming email messages and invoke a Lambda function within the flow.
    1. See Set up email in Amazon Connect to learn about associating flows to email addresses.
  2. Use a Lambda function to access the email message from S3 using:
    1. ListContactReferences– To get the email message location and a list of attachment locations
    2. GetAttachedFile– To download the email message (AssociatedResourceArn) from S3 to be sent to the automated solution of your choice
  3. Send the email message to an AI solution of your choice (e.g. Amazon Bedrock)
    1. Prompt the automated solution to detect intent, sentiment, keywords, and PII detected within the email message
  4. Return response from the Lambda function to the flow:
    1. Intent (e.g., “Password reset”, “Windows update”, or “Wi-Fi not working”)
    2. Sentiment (e.g., Happy, Mad, Sad, or Neutral)
    3. Keywords (e.g., customer’s name, address, or phone number)
    4. PII detected (e.g., True/False)
  5. Perform the following within the flow based on the values returned:
    1. Automatically responding to known FAQs or common questions from the end-customer, using the “Send message” block, whenever possible
    2. Escalating the email contact within a queue based on the end-customer’s sentiment
    3. Populating the end-customer’s profile based on information they have shared
    4. Notifying a supervisor of PII detected within the email

A reference implementation is available on GitHub. It utilizes the Anthropic Claude Haiku model available on Amazon Bedrock. This implementation generates the required outputs in a key/value format, which is leveraged for subsequent steps within Amazon Connect Flows.

Conclusion

By embracing AI-driven automation in email management, organizations can transform how they handle customer support. It enables them to scale operations without sacrificing the quality of service, even as email volumes rise. Implementing this solution allows Amazon Connect customers to handle customer inquiries efficiently while maintaining a high level of personalization and responsiveness.

Ready to transform your customer service experience with Amazon Connect? Contact us.