You will learn
Learn how to create a flow to reply to inbound SMS messages. This flow makes it simple to run polls and surveys via SMS. It can send automated responses and update profile properties for those who text their answer.
You can set up this flow to respond to:
- Any word (including, but not limited to, SMS subscribe keywords).
- Multiple words, or multiple spellings of the same word.
Before you begin
Before setting up this type of flow, know that:
- You must change the Unrecognized Keyword autoresponder to only send to those without SMS consent.
- The flow will only send to SMS subscribers.
- You need to have sent at least 1 SMS message previously.
- Otherwise, you will not be able to properly set up the flow's trigger filters.
How to change the unrecognized keyword autoresponder
To adjust the unrecognized keyword autoresponder:
- Click your account name in the lower left corner.
- Navigate to Settings > SMS > Sender preferences.
- In the Compliance keywords section, click Edit next to When no keyword is recognized.
- Open the dropdown next to Automatically respond to.
- Select non-consented profiles only.
- Click Save.
Messaging process
This flow works best when you ask subscribers to text certain words. Because of this, there are 3 distinct messages we’ll be discussing:
-
Outbound
The message that asks subscribers for information.
-
Inbound
The message subscribers send back to you with information.
-
Flow response
The automated response that replies to the subscriber’s inbound message.
How this flow works in Klaviyo
The flow’s main trigger is the Sent SMS metric, which logs when any inbound message is sent from your subscribers to your brand number.
There are 2 trigger filters:
-
Message > equals [ID]
Checks if the outbound message (specifically, the message ID) is the last message someone received. -
Message body > contains [word]
Checks if a specific word appears anywhere in the inbound message, including as part of any other word (e.g., if you input "update," "updates" will also trigger the flow).- Note that the word does not need to be an SMS subscribe word (although it can be).
If a single text contains words that are triggers for 2 or more flows, only the first matched word will trigger a flow.
What does the Message filter do?
Generally, people are only going to reply to the most recent SMS message they received.
The Message filter looks up the recipient’s most recent message and checks if it’s the same as your outbound message. To do this, it uses the ID of the message, which is a unique string of characters in Klaviyo attached to every form, message, flow, etc.
How to reply automatically to inbound SMS messages
There are 2 parts for setup:
- Copying the unique ID of the outbound message.
- Creating the flow.
Do not send the outbound message until you finish setting up your flow. The flow must be live so that it can start sending as soon as a subscriber responds to your outbound text.
If you have never sent an SMS with Klaviyo, you will need to send at least 1 (and it should be unrelated to the response flow described here). Otherwise, the proper trigger filters will not appear when you go to set up this flow.
Copy the message ID
To find the 6-digit message ID:
- Navigate to the Campaigns or Flows tab.
- Click into the Content screen for the campaign or flow message.
- Configure the content for the messages
- The next steps depend if the message is a campaign or flow:
- Flows:
- In the SMS message editor, look at the URL.
- Highlight the string of numbers and letters.
- Copy this string.
- Campaigns:
- Select Save & continue in the upper right.
- Click Campaigns in the left-hand sidebar.
- Find and hover over the campaign you just created.
- In the modal that pops up, click Copy message ID.
Note: for campaigns, using either the ID in the URL or the campaign ID (typically ~26 digits) does not work. You must copy the message ID, as shown below.
- Flows:
- Paste the string somewhere safe until you need it again.
The message ID is always 6 digits. If you find that the ID you copied is longer than that, you may be using the wrong type of ID.
Set up the response flowSet up the response flow
Create the flow and trigger
- Navigate to Flows > Create flow > Create from scratch.
- Select All triggers > Metric.
- Choose Sent SMS as the flow trigger action.
- In the Trigger filters section, click Add.
- Click Add trigger filter.
- Use the following filters:
-
Message > equals [add the copied message ID]
AND -
Message body > contains [word 1]
OR - Message body > contains [word 2]
- Note: include alternate spellings, typos, or capitalizations by adding OR between the filters.
-
Message > equals [add the copied message ID]
- Click Save > Confirm and save.
If you don't see the options for Message or Message body, it means you haven't sent an SMS with Klaviyo, so these filters can't appear yet. The quickest way to fix this is by creating an SMS campaign to send to yourself (sending a preview does not count), or you can choose to wait until you begin send SMS campaigns or flow messages to subscribers.
Add in your splits and SMS responses
The next steps depend on how many words you’re using to trigger the flow.
When determining the number of words, ignore any alternate spellings, typos, or capitalizations of the same word.
Below are specific instructions depending on the number of triggers words you have.
1 trigger word
- Add an SMS message directly below the trigger.
- In the right sidebar, click Edit in the Content section.
- Customize the content for that SMS.
- Select Save.
2 trigger words
Here, let's say we asked if subscribers preferred dark or blonde roasts.
- Add a trigger split after the trigger.
- Use Message body > contains [word 1], with the OR condition between any other spellings of that word.
- On the YES path, add an SMS message and customize the content to the word you used in the split (i.e., word 1).
- On the NO path, repeat the previous step, changing the content for the other word (i.e., word 2).
3 or more trigger words
- Add a trigger split after the trigger.
- Use Message body > contains [word 1], with the OR condition between any other spellings of that word.
- On the YES path, add an SMS message and customize the content to that word.
- On the NO path, add another trigger split.
- For the trigger split on the NO path, use Message body > contains [word 2] along with the OR condition between any alternate spellings.
- Under the new trigger split, place an SMS on the YES path.
- Repeat the steps 4-6 as many times as needed.
- Add an SMS to the final NO path.
Optional: add profile properties based on the inbound SMS
- Drag a Profile property update action after the time delay.
- Set the action to Create a new property and base the property on the word a subscriber texts in.
Note that the property must exist on at least 1 profile before you can use it for an Update profile property action.
Outcome
Now that the flow is set up, all you need to do is set it live. Then, you can send your outbound message to subscribers.
When a SMS subscriber replies with a trigger word, you can automatically:
- Respond back with a personalized message.
- Add a profile property based on the subscriber’s inbound message.
Additional resources
Learn other ways to respond to subscribers: