AWS Contact Center

Building a real time customer sentiment email notification system using Contact Lens for Amazon Connect, Amazon EventBridge and Amazon Simple Notification System

Providing great customer service is a key business differentiator in today’s highly competitive world in which we live. Typically, businesses measure customer satisfaction (CSAT) with post call surveys and reviewing of call recordings, both of which have their own associated challenges. CSAT surveys typically suffer from low response rates, can be subject to bias and do not uncover the root cause of a customer’s problem. Reviewing call recording is a time-consuming activity, typically an average contact center checks no more than 2% of their recordings and as such valuable insights are not surfaced.

Using Contact Lens sentiment operator combined with Amazon EventBridge and Amazon Simple Notification Service you are able to build a simple and highly reliable notification system supporting various delivery mechanisms including email, SNS and mobile push notification. From there, supervisors can listen in on the live call and provide guidance to an agent over chat to resolve the issue faster. If necessary, supervisors can have the call transferred from the agent, both which ensures customers are provided with the best experience possible.

Overview of the solution

This post provides an example of how to build a real-time Contact Lens sentiment rule that is triggered when customer sentiment has remained low during a call. Using EventBridge and Simple Notification Service we will see how we can quickly build a real-time alerting system to notify supervisors and other specialist staff that their assistance is required.

The following diagram depicts the example solution:

Prerequisites

For this walkthrough, you should have the following prerequisites:

For details on initial setup review the Get started With Amazon Connect section of the Administrator Guide, and the following blog post Real-time customer insights using machine learning with Contact Lens for Amazon Connect

Walkthrough

Setup Contact Lens real-time rule

  1. Navigate to the Amazon Connect admin console
  2. Navigate to the rules section using the left-hand navigation bar and “Create a rule” of type Contact lens

The rules engine is divided into three sections, in the first section “Define conditions” we will configure a real-time rule and the rule conditions.

  1. Select “When A Contact Lens real-time analysis is available
  2. Select “Add condition” and choose “Sentiment – Time Period

In this walk-through this is the only condition we will use. However, you can create more complex filters by combining additional conditions such as Agents, Queues, Contact attributes and Words or phrases. For example, we could configure this rule to only monitor calls handled by trainee operators that may benefit from additional support.

  1. Build the rule as described and then select “Next”:
    • Select “Customer” for this rule as we are interested in the customer’s experience
    • Select “sentiment was negative” to allow us to monitor and alert when a customer’s experience has not been favorable
    • Select “during the past 5 seconds of the contact”. This will help us quickly test the rule but should be modified as required

Define actions“ is the second section of the rule engine and controls which actions are taken when our rule is triggered.

  1. First “Assign contact category” the category name “Customer-sentiment-is-low

When our rule is triggered, the contact will be automatically categorized using this category name. This can be useful when performing additional post call analysis, such as allowing supervisors to search for a specific set of call recordings based on their category.

Next, we will define an EventBridge action. When our rule is triggered, an event will be published to EventBridge. In this example we will use EventBridge to send a real-time email notification via Simple Notification Service, this however could be used to call a Lambda Function, Step Functions state machine, API Gateway and many other native integrations. For a full list of all supported targets review the EventBridge user guide.

  1. Select “Add action” and choose “Generate an EventBridge event
  2. In the “Action name” field enter “Customer-sentiment-is-low” and then select “Next

Review and save” is the final section of the rule engine.

  1. Compare your rule to the example below and click “Save

You will now be returned to the Rules section of the UI that summarizes rules, triggers and associated actions. By clicking on a rule name, you are taken back to the rule engine where you can make adjustments as required.

Setup Amazon Simple Notification Service

Using Simple Notification Service, a fully managed messaging service for both application-to-application and application-to-person communications we can quickly setup email notification when our Contact Lens rule is triggered.

  1. From the AWS Console navigate to “Amazon Simple Notification Service
  2. Select “Topics” from the left navigation bar and select “Create topic
  3. Build the topic as detailed below and then select “Create topic“:
    1. Type : Standard
    2. Name : Amazon_Connect_Supervisor_Alert
    3. Display name : AmzConnect

  1. Take note of the topic ARN, we will use this when creating our email subscription
  2. Select “Create subscription” and complete the information as detailed below, when done select the “Create subscription” button
    • Topic ARN : Select the topic you noted down in the previous step
    • Protocol : Email
    • Endpoint : Your email address

Amazon Simple Notification Service offers various subscription protocols in addition to email, review the Configuring Amazon SNS section of the Developer Guide for more information.

  1. When the email topic is created, you will need to confirm your email address before receiving messages. To confirm a subscription:
    • Check your email inbox and choose Confirm subscription in the email from Amazon SNS
    • Amazon SNS opens your web browser and displays a subscription confirmation with your subscription ID

Setup an Amazon EventBridge rule

Next, we will create an EventBridge rule that will:

  • Watch for the Contact Lens event that is published when our “Customer-sentiment-low” rule is triggered
  • Send the event information to the Simple Notification Service topic for onward email delivery
  1. From the AWS Console navigate to “Amazon EventBridge” and select “Create rule
  2. Enter in the name field “Contact-Lens-Customer-sentiment-low
  3. Enter in the description field “Real time notification when customer sentiment is low

  1. Define an event pattern as detailed:
    • Select “Event pattern
    • Select “Custom pattern”
    • Copy and paste the below pattern into the “Event pattern” text field and then click “Save”
      {
        "source": ["aws.connect"],
        "detail-type": [
          "Contact Lens Realtime Rules Matched"
        ],
        "detail.ruleName": ["Customer-sentiment-is-low"]
      }

  1. Scroll down to “Select targets” and select “SNS topic”. Choose the topic we created named “Amazon_Connect_Supervisor_Alert” and then select “Create

 

Now if you call into your Amazon Connect instance you can test the real time notification system. For ease of testing we have set the rule to trigger after only 5 seconds of negative customer sentiment. Try saying a few typical complaint phrases to the agent, shortly after you should receive an email notification containing all the relevant event information.

Cleaning Up

To avoid incurring future charges, delete the Contact Lens rule, EventBridge rule and Simple Notification Service topic and subscription that we created in this blog.

Conclusion

In this blog we showed you how to create a real-time customer sentiment email notification system. We look forward to seeing what other event driven architectures you build using the new Contact Lens rule operators and EventBridge integration. To get started please visit your Amazon Connect admin console!