View a markdown version of this page

Set up SMS messaging in Connect Customer - Amazon Connect Customer

Set up SMS messaging in Connect Customer

You can enable SMS messaging on Connect Customer so your customers can text you from their mobile device. With Amazon Lex, you can automate responses to their questions, saving agents valuable time and effort.

This topic explains how to set up and test SMS messaging for Connect Customer. You use AWS End User Messaging SMS to procure an SMS-enabled phone number, enable two-way SMS on the number, and then import it into Connect Customer.

Using one phone number that is shared for both voice and SMS isn't supported.

Step 1: Request a number in AWS End User Messaging SMS

Important

Some countries require phone numbers to be registered for use in the country. It can take up to 15 business days to process a registration request after it is submitted. We strongly recommend you begin this process early. For more information about registering, see Registrations.

We also strongly recommend reviewing Best practices for requesting SMS numbers before requesting a number.

For instructions for using the CLI to perform this step, see Request a phone number in the AWS End User Messaging SMS User Guide.

  1. Open the AWS SMS console at https://console.aws.amazon.com/sms-voice/.

  2. In the navigation pane, under Configurations, choose Phone numbers and then Request originator.

  3. On the Select country page you must choose the Message destination country from the drop down that messages will be sent to. Choose Next.

  4. On the Messaging use case section, enter the following:

    • Under Number capabilities choose either SMS or Voice, depending on your requirements.

      Important

      Capabilities for SMS and Voice can't be changed after the phone number has been purchased.

      • SMS – Choose if you need SMS capabilities.

      • Voice (text to audio) – Choose if you need voice capabilities.

    • Under Estimated monthly SMS message volume per month – optional choose the estimated number of SMS messages you will send each month.

    • For Company headquarters - optional choose either of the following:

      • Local – Choose this if your company headquarters is in the same country as your customers who will receive SMS messages. For example, you would choose this option if your headquarters is in the United States and your users who will receive messages are also in the United States.

      • International – Choose this if your company headquarters is not in the same country as your customers who will receive SMS messages.

    • For Two-way messaging choose Yes if you require two-way messaging.

  5. Choose Next.

  6. Under Select originator type choose one of the recommended phone number type or one of the available number types. The available options are based on the use case information you filled out in the previous steps.

  7. Choose Next.

  8. On Review and request you can verify and edit your request before submitting it. Choose Request.

  9. A Registration Required window may appear depending on the type of phone number you requested. Your phone number is associated with this registration and can't send messages until your registration has been approved. For more information about registrations requirements, see Registrations.

    1. For Registration form name enter a friendly name.

    2. Choose Begin registration to finish registering the phone number or Register later.

      Important

      Your phone number can't send messages until your registration has been approved.

      You are still billed the recurring monthly lease fee for the phone number regardless of registration status.

Step 2: Enable two-way SMS on the phone number

After you have successfully procured a phone number from AWS End User Messaging SMS, you enable two-way SMS on the phone number with Connect Customer as the message destination. You can enable two-way SMS messaging for individual phone numbers. When one of your customers sends a message to your phone number, the message body is sent to Connect Customer.

For instructions for using the CLI to perform this step, see Two-way SMS messaging in the AWS End User Messaging SMS User Guide.

Note

Connect Customer for two-way SMS is available in the AWS Regions listed in Messaging integrations.

  1. Open the AWS SMS console at https://console.aws.amazon.com/sms-voice/.

  2. In the navigation pane, under Configurations, choose Phone numbers.

  3. On the Phone numbers page choose a phone number.

  4. On the Two-way SMS tab choose the Edit settings button.

  5. On the Edit settings page choose Enable two-way message, as shown in following image.

    The AWS End User Messaging SMS edit settings page.
  6. For Destination type choose Connect Customer.

  7. For Connect Customer in Two-way channel role choose Choose existing IAM roles.

  8. In the Existing IAM roles drop down choose an existing IAM role as the message destination. For example IAM policies, see IAM policies for Connect Customer in the AWS End User Messaging SMS User Guide.

    Tip

    If you can't create a policy or role, double-check that your Connect Customer instance is in a Region supported by Connect Customer SMS.

  9. Choose Save changes.

  10. In the Import Phone Number to Connect Customer window:

    1. For the Incoming messages destination drop down choose the Connect Customer instance that will receive incoming messages.

      The AWS End User Messaging SMS import phone numbers page.
    2. Choose Import Phone Number.

  11. After the number is successfully imported to Connect Customer, you can view it in the Connect Customer admin website: In the left navigation, choose Channels, Phone numbers. The SMS number appears on the Phone numbers page, as shown in the following image.

    The Connect Customer admin website, the Phone numbers page.

Step 3: Update flows to branch on SMS contacts

If you have existing flows that you want to branch when a contact uses SMS, add a Check contact attributes block to your flows. This block enables you to send SMS contacts to a specific queue, or take another action.

  1. Add a Check contact attributes block to your flow, and open the Properties page.

  2. In Attribute to check section, set Namespace to Segment attributes and key to Subtype.

    For more information about Segment attributes, see SegmentAttributes in the ContactTraceRecord topic.

  3. In the Conditions to check section, set condition to Equals and value to connect:SMS.

    The following image of a Properties page shows it's configured to branch when the contact comes in on the SMS channel.

    The properties page of the check contact attributes block.
  4. Associate the SMS phone number with the flow: In the left navigation, choose Channels, Phone numbers, choose the SMS number, and then choose Edit.

    The Edit phone number page.
  5. Under Flow/IVR, choose the flow you updated, and then choose Save.

    The properties page of the check contact attributes block.
Tip

When you first purchase a phone number, the phone number's status is Pending. When the phone number is ready to use, the phone number's status is Active. If the phone number requires registration, then you must complete that step before the phone number's status changes to Active.

Step 4: Test sending and receiving SMS messages

In this step you use the Contact Control Panel (CCP) and a mobile phone to test sending and receiving SMS messages.

  1. In your CCP, set your status to Available.

  2. Using a mobile device, send an SMS to the phone number that you requested in Step 1: Request a number in AWS End User Messaging SMS.

    Tip

    If your AWS End User Messaging SMS phone number is still in the SMS sandbox, you can only test sending and receiving SMS messages with verified destination numbers that you have configured. For move instructions, see Moving from the SMS sandbox to production.

    The agent's CCP and the customer's phone sending SMS messages.

Step 5: Prerequisites for going into production

Before you use SMS in production mode, make sure you've completed the following prerequisites for AWS End User Messaging SMS.

Step 6: (Optional) Set up self-managed opt-out message processing

Optionally, you can enable self-managed opt-out for your SMS number. For details about this feature, see Self-managed opt-outs. For setup instructions, see Managing opt-out lists.

After enabling self-managed opt-out, you should set up Lambda functions and flow blocks to process SMS opt-out requests from customers and block agents from messaging customers who have opted out.

Important

If you enable this feature, you're responsible for responding to HELP and STOP requests. You're also responsible for tracking and honoring opt-out requests. Many countries, regions, and jurisdictions impose severe penalties for sending unwanted SMS messages. If you enable this feature, make sure you have systems and processes in place for capturing and managing opt-out requests.

Two-way communication with agents

Use this setup when the phone number with self-managed opt-out enabled is used for two-way communication with agents.

Before proceeding, your Connect Customer instance should have the following settings and resources configured:

  • An SMS phone number in your instance.

  • You can send and receive messages on that phone number.

  • When a customer sends a message to this phone number, they are routed to live agents.

  • Customer Profiles is enabled and working correctly.

  1. Create an opt-out message processing Lambda function for the initial chat message.

    1. Go to the AWS console for Lambda, and choose Create function with all the default settings.

    2. After the function is created, under the Code tab, add code for handling customer opt-out into the index.mjs file.

    3. Create an IAM policy to give the Lambda function sufficient access to invoke the APIs in the code. Create a policy with the required permissions and attach it to your Lambda execution role:

      • The policy should contain permissions to invoke all APIs required to process customer opt-out requests.

      • Permissions for kms:GenerateDataKey and kms:Decrypt are required if Customer Profiles is used.

      • The Lambda execution role name can be found by choosing the Configuration tab, then going to Permissions.

  2. Create an opt-out message processing Lambda function for all other messages in the contact.

    1. Go to the AWS console for Lambda, and choose Create function with all the default settings.

    2. After the function is created, under the Code tab, add code for handling customer opt-out into the index.mjs file.

    3. Attach the same policy you created in step 1 to your Lambda execution role.

  3. Import both Lambda functions into your Connect Customer instance.

    1. Import the Lambda function created in step 1 by following the instructions in Grant Connect Customer access to your AWS Lambda functions.

    2. Run the following CLI command with your AWS account credentials to integrate the Lambda function created in step 2 with the Message Processing flow block:

      aws connect create-integration-association \ --instance-id your-connect-instance-id \ --integration-type MESSAGE_PROCESSOR \ --integration-arn arn:aws:lambda:region:account-id:function:function-name \ --region aws-region
  4. Create or update the contact flow.

    Create a contact flow with the necessary flow blocks at the beginning, or add them to the existing contact flow that is associated with the phone number that you've enabled self-managed opt-out for.

No two-way communication with agents

Use this simpler setup when the phone number with self-managed opt-out enabled is NOT used for two-way communication with agents (meaning when a customer sends a message to that phone number, they will NOT be routed to live agents).

  1. Set up an Amazon Lex bot to process customer opt-out requests.

    1. Create an Amazon Lex bot and use it in a Connect Customer flow by following the instructions in Add an Amazon Lex bot to Connect Customer.

    2. When you get to the step for creating bot intents, create a bot with the following two intents:

      • Intent 1: CustomerOptOutIntent – This intent is triggered when a customer sends an opt-out keyword like "STOP" to the phone number. Configure it to reply with a message of your choice.

      • Intent 2: FallbackIntent – This intent is triggered when a customer sends any other message to the phone number. Configure it to reply with a different message of your choice.

    Note

    If you want to perform other checks and update an opt-out list of your choice, you need to implement a Lambda function with all the custom logic and link it to the bot.

  2. Create or update the contact flow.

    Create a contact flow with the necessary flow blocks at the beginning, or add them to the existing contact flow that is associated with the phone number that you've enabled self-managed opt-out for.

Customers not receiving SMS messages?

Before opening an AWS Support ticket, please verify that you've completed Step 5: Prerequisites for going into production.

Next steps

We recommend the following steps to provide the best experience for your agents and customers.