Example US Campaign
This example US campaign aims to give you a high-level overview of how to create a campaign in MEP. The scenario uses the imaginary "ACME restaurants", a new franchised restaurant chain that wants to interact via SMS with end users. The campaign setup includes:
- A service to subscribe end users and send discount codes.
- A service to receive end user feedback, which is initiated through a broadcast message.
- Services to let end users unsubscribe (STOP or STOPALL) and request help (HELP).
Discount code service
The ACME franchised restaurant, based in the US, has recently opened and wants to entice new diners to the store. Advertisements ask end users to join an SMS discount campaign. Users initially opt-in via an SMS keyword "YES", after which the campaign sends them vouchers to encourage them to visit their local restaurant.
The discount codes are generated by MEP and sent onto the ACME servers so that they can accurately track the codes. The service is provided as standard rate messaging. As with most campaigns, the campaign must allow end users to unsubscribe through a STOP message.
Note that the flexibility of MEP means that there are several ways you could set up the campaign. For example, in this scenario, a service is used to distribute two discount codes, with a week between sending each code. However, you could use a "user scheduled" subscription to do this process or send messages ad hoc via a broadcast. The discount codes could be fetched from your servers from an external platform, or images held in the MEP Content Repository.
A summary of the set up:
- Set up a subscription to store the end users' mobile numbers
- Create a service that:
- Adds the numbers to the subscription and welcomes the end user with a discount code
- Waits one week, then sends another discount code
- Create keywords that route to the service
Step 2: Create the service that subscribes the end user
Handers used by the service
Managing Subscriptions: Subscribe
|
Checks whether a mobile number is in a specific subscription and, if not, the number is added to the subscription. The handler can also create subscriptions.
|
Send: SMS
|
Sends the end user an SMS message.
|
Variables: Set
|
Enables you to create custom variables as part of a service. This handler will also update the variable's value whenever it is triggered in the service.
This handler is to create the discount codes for each end user.
|
Integration: HTTP Poke
|
Enables MEP to push data to an external platform.
This handler sends the discount code and mobile number of the end user to the ACME servers.
|
Wait: Wait
|
Waits for a set period of time before continuing with the service.
This handler is used to delay sending the next discount code.
|
We recommend saving your service regularly.
- Click the Services tab.
- Click Create Service Collection, and then enter a Name and optional Description. For this example, name the collection Voucher Service.
-
Click Save.
Voucher Service appears in your Collections list.
- Click the
to the left of Voucher Service, and then click Create Service.
- On the Template for new service page, select Custom, and then click Continue.
-
On the Service Details page, enter Create Subscription for the Name and an optional Description for the service, and then click Save.
The new service appears on the Console.
- Add the Subscribe handler to the canvas (
).
-
Click the Subscribe handler, and then make sure that By Subscription is selected, and then set the handler to use Discount Campaign for the Subscription Collection, and Discount Subscribers for the Subscription type (
). Connect the handler to the Starting point.
-
Add a Send SMS handler (
) to the console.
-
Select the Send SMS handler, select an SMS Account, and in the Message field add the following message to return if an end user has previously subscribed (
). Connect the handler to the Existing Subscription outcome of the Subscribe handler.
-
Add a Set Variable handler (
) to create the first discount code to send back to the end user. The handler uses an expression to create a seven characters-long random PIN. This code is stored as a user variable.
-
Click the Variables: Set handler, set the following (
), and then connect the handler to the New Subscription outcome of the Subscribe handler (
)
- Set the scope to
user
.
- Set the Key to
code1
.
- Set the Value to generate the PIN:
${af:generatePin(7,true)
.
-
Add an HTTP Poke handler (
) to send the code and the end user's mobile number to an external server.
In this example, the ACME server expects to receive a parameter for both the code and the end user's mobile number.
-
Select the HTTP Poke handler, add the following variables (
), and then connect the handler to the Set outcome of the Variables: Set handler (
).
- In the URL section, enter
http://www.acme-example.com/ompoke.cgi
-
In the Headers section, add each of these to a separate line:
Note: Each value in the Header section must be added to a separate line. See Creating an HTTP Poke or Get External Data Handler for more information about Header fields
- Add a Send SMS handler (
) to thank the end user and send them their first code.
- Click the handler, add the following information (
), and then connect the handler to the Continue outcome of the HTTP Poke handler (
).
- From the SMS Account drop-down list, select the Account to use for messaging
- In the Message section, add the following:
Welcome to ACME restaurant discounts! Text STOP to cancel, & HELP for help. Msg&Data Rates May Apply. Show this PIN in-store:${user.code1} for a free appetizer.
- Add a Wait handler (
).
-
Click the handler, add the following information (
), and then connect the handler to the Continue outcome of the Send SMS handler (
):
- From the Wait drop-down list, select For fixed interval.
- In the For Interval section, set the time to 7 and the unit of time to Days.
- Add another Set Variable handler (
) to create a second code.
- Click the handler and add the following information (
), then connect it to the Continue outcome of Wait (
).- From the Scope drop-down list, select user.
- For the Key, enter
code2
. - For the value, enter the variable that generates the PIN:
${af:generatePin(7,true)}
.
- Add an HTTP Poke handler (
).
- Click the HTTP Poke handler, enter http://www.acme-example.com/ompoke.cgi in the URL section (
), and then connect the handler to the Set outcome of Variables: Set (
).This sends the code to the external server.
-
Lastly, add an Send SMS handler (
) that sends the end user their second code.
-
Click the handler, add the following (
), and then connect the handler to the Continue outcome of the HTTP Poke handler (
)
- From the SMS Account field, select the SMS account for this handler.
- In the Message field, add the following:
Your 2nd ACME restaurant discount is for 2-4-1 dining. Just show this PIN in-store:${user.code2}
- Save the service.
See also Services Overview.
Customer feedback service
ACME restaurant wants to ask diners for feedback. To do this, they need to send a message out to end users asking for feedback, then send a series of questions via SMS through a service that waits for each response before asking the next question.
The following example shows how you can use MEP to request end user feedback that includes both a multiple choice and free-form responses. This set up assumes that you already have a list of end users that you have permission to message asking for feedback.
A summary of the setup:
- Create a Console inbox to hold free-form responses.
- Create a service that acts as the questionnaire. This will store multi-choice response answers as service variables, and send free-form responses to the Console inbox.
- Send a broadcast to initiate feedback. This will also route responses to the broadcast to the service for a limited time.
Step 2: Creating a questionnaire service
Handlers used by the service
Send: SMS
|
Sends the end user an SMS message.
|
Wait: Wait for Response
|
Waits until it has received a response from the end user before continuing through the service.
This handler is used after every SMS message with a feedback question. It makes sure that the service has had a response back from the end user before continuing to the next handler (which parses the response).
|
Branch on: Message Contents
|
Branches "yes" or "no" based on whether the message contains specified text.
This handler is used multiple times to look at the response from the end user and branch based on the answer, which is then turned into a variable with the Set Variables handler.
|
Variables: Set
|
Enables you to create custom variables as part of a service. This handler will also update the variable's value whenever it is triggered in the service.
This handler is used to turn the response from the end user into a service variable that counts how many responses match.
|
Send: Forward SMS
|
Forwards an SMS message to either a Console inbox or an external URL.
This is used to forward free-form responses to the Console inbox.
|
- In the Services tab, create a new "Custom service; e.g. named "feedback service".
- Add a Send SMS handler (handler 1 in the diagram) to ask the first question. E.g.:
Thanks for responding! Please tell us YES or NO whether you enjoyed your last dining experience.
Connect this to the starting point.
- Add a Wait for Response handler (handler 2). Set this to capture all responses, excluding STOP. Connect this to the previous handler.
- Add the first Branch On Message Contents handler (handler 3). Set this to match the text "
YES
" and appearing "exactly
".
Connect this to "Response Received" outcome for the previous handler.
-
Add another Branch on Message Contents handler (handler 4). Set this to match the text "NO
" and appearing "exactly
".
Connect this to "No" outcome of the first Branch On Message Contents handler (handler 3).
Note: In this setup, anything which does not match ‘yes’ or ‘no’ is ignored. If desired, you could choose to send another SMS message back when the received message is not 'yes' or 'no' asking the end user to retry their answer. You would then loop the outcome back to the Wait for Response handler (handler 2).
- Add a Set Variables handler (handler 5) to count the number of "no" responses:
- Set the scope to "service"
- Set the Key to "q1_no"
- Set the Value to an expression which counts q1_no: {service.q1_no + 1}
Connect this to the "yes" outcome for handler 4.
- Add a Set Variables handler (handler 6) to count the number of "yes" responses:
- Set the scope to "service"
- Set the Key to "q1_yes"
- Set the Value to an expression which counts q1_no: {service.q1_no + 1}
Connect this to the "yes" outcome for handler 3.
-
Add a Send SMS handler (handler 7) to ask the next question; for example:
Thanks for your feedback so far. Please rate your main meal by texting 1, 2, or 3, where 1=excellent, 2=adequate, and 3=poor.
Connect this to "set" outcome of both of the Set Variable handlers (handlers 5 and 6).
- Add a Wait for Response handler (handler 8). Set this to capture all responses, excluding STOP.
Connect this to the previous Send SMS handler (handler 7).
- Add a Branch On Message Contents handler (handler 9). Set this to match the text "
1
" and appearing "exactly
".
Connect this to the "Response Received" outcome for handler 8.
- Add two more Branch On Message Contents handlers (handlers 10 and 11). Set handler 10 to match the text "
2
" and handler 11 to match the text "3
" .
Connect handler 10 to the "no" outcome of handler 9.
Connect handler 11 to the "no" outcome for handler 10.
- Add a Set Variables handler (handler 12) to count the number of "3" responses:
- Set the scope to "service"
- Set the Key to "q2_3"
- Set the Value to an expression which counts q2_3: {service.q2_3 + 1}
Connect this to the "yes" outcome for handler 11.
-
Add two more Set Variables handlers (handler 13 and 14) to count the number of "2" and "1" responses respectively.
Connect handler 13 to the "yes" outcome for handler 10.
Connect handler 14 to the "yes" outcome for handler 9.
-
Add a Send SMS handler (handler 15) to ask the next question; for example:
Thanks for your response. If there is any further feedback you'd like to give, please text it to us now.
Connect this to "set" outcome of the three Set Variable handlers (handlers 12, 13, and 14).
- Add a Wait for Response handler (handler 16). Set this to capture all responses, excluding STOP.
- Connect this to the previous Send SMS handler (handler 15).
- Add a Forward SMS handler (handler 17). Set the handler to forward to the Console inbox (e.g. the "feedback" inbox).
Step 3: Send a broadcast requesting feedback to customers
- In the Broadcasts tab, create a new "Send SMS" broadcast.
-
Add a message to encourage end users to participate with the questionnaire; e.g:
We would be grateful if you could take a minute to help make our restaurants even better. Please text YES if you'd like to take part in a quick survey.
- Select the end users you wish to target (i.e. select a subscription or enter users manually).
- Open the "Advanced Settings" and click "enable routing".
- For "Push messages to service" select the feedback service.
- Select "Route all responses starting with" and in the field enter "YES"
- Set the "Capture responses for" to the length of time you want to wait for responses back.
This means that any end user who received the broadcast message and texts back "yes" will route to the feedback service.
- Send the broadcast message.
See also Sending an SMS Broadcast Message.
Seeing the results of the questionnaire
You can see the results of the first two questions by clicking the "Variables" button on the service editor screen for the service.
To see the free-form feedback, go to the Console inbox.
Providing HELP for the campaign
As part of their campaign, ACME needs to make sure that end users can access support information via a HELP message. In this example, it is a phone number to a call center.
A summary of the set up:
- Create a service to send the HELP message back to the end user
- Create a keyword that routes to the service
Step 1: Create the service that sends the help message
- In the Services tab, create a new "custom" service; e.g. named "HELP service".
-
Add the Send SMS handler to the canvas, with a message to send back if the end user has sent HELP to your short code:
ACME restaurant discounts sends discount codes you can claim in-store. Msg&Data Rates May Apply. Contact 800 888-8888 for help. Reply STOP to cancel.
- Save the service.
Step 2: Create the keyword routing
- In the Routing tab, click "Add Keyword" under the short code for this campaign.
- Create the keyword "HELP" pointing to "HELP service".
- Save the keyword. The service is now live.
STOP and STOPALL services
The campaign requires a STOP and STOPALL service to remove end users from any campaigns.
Summary of the setup:
- Create a service that removes numbers from the specific subscription.
- Create the service that unsubscribes the end user from all subscriptions.
- Create keywords that route STOP and STOPALL messages to the service.
Step 1: Create the service that unsubscribes the end user from a single subscription
Handers used by the service
Managing Subscriptions: Unsubscribe
|
Removes the end user from one or more subscriptions.
|
Send: SMS
|
Sends the end user an SMS message.
|
- In the Services tab, create a new Custom service — for example, a STOP service.
- Add the Unsubscribe handler to the canvas. Set this to remove end users from the mailing list Discount Subscribers.
Connect this to the starting point.
-
Add a Send SMS handler to the canvas, with a message to send back if the end user has previously subscribed:
You have now unsubscribed from the ACME restaurant discount campaign.
Connect this to the Default outcome of the Unsubscribe handler.
- Save the service.
Step 3: Create the keyword routing
- On the Routing tab, click Add Keyword under the short code for this campaign.
- Create the keyword STOP pointing to STOP service.
- Save the keyword. The service is now live.
Follow the same steps as above to add additional keywords (such as STOPALL or QUIT) to point to the STOP and STOPALL services.