Introduction
Twilio is a customer engagement platform used by hundreds of thousands of businesses and more than ten million developers worldwide to build unique, personalized customer experiences.
library_add_check |
Prerequisites Please make sure you have access to your Twilio dashboard. |
Configure as SMS connector (Service Provider)
Below is a step-by-step explanation for setting up Twilio as your desired SMS provider on MoEngage. Before you go ahead, make sure to keep the login credentials of your Twilio account handy. You can also reach out to the MoEngage Customer Success team for assistance.
info |
Information We've revamped our dashboard settings. This article describes the steps to be followed to configure Infobip as a Custom Connector (Service Provider) in the revamped settings UI and the older UI. |
Configure in Revamped UI
Log in to the MoEngage Dashboard and follow these steps:
- Navigate to Settings -> Channel -> SMS -> Sender Configuration.
- Click +Add Service Provider at the top right corner.
- Select Twilio in the Add Sender screen.
-
When setting up your account for the first time, you have to enter the authentication details. Once you log in to your Twilio account, you can find the required details in your Twilio console.
Username: This is the Twilio Account SID
Password: This is the Twilio Auth Token -
After entering the Twilio Account SID and Auth token, click Save to save the authentication details. Twilio authentication is at the account level, and you do not need to add this for each sender. However, if you need to change the authentication parameters, you can click on the Reauthenticate link next to Twilio and change the settings.
You can configure the Twilio sender now.
- Add the following details in the Sender Details screen.
Field Description Mark as default
This toggle will be disabled during sender creation. The first sender to be created in your MoEngage account will be marked as the default sender for your SMS campaigns. You can change the default sender by following the steps mentioned in Marking a sender as default.
Sender name
This field identifies the Sender. Type the name of the sender here.
Sender type
The Sender type can either be one of the following:
- Short Code
- Long Code
- Messaging Service
- Alphanumeric Sender ID
Select the appropriate sender type.
Sender ID
This is the number from which SMS will be sent to your users. Make sure to add the number corresponding to the type you chose. For more information, refer to ShortCodes, LongCodes, and MessagingServices.
Note: When the Sender type is Messaging Service, enter the Messaging Service SID in the Sender ID field.
Mobile Originated (MO) callback URL
This callback URL depends on the data center (DC) to which your workspace belongs. The callback URLs are listed below:
- For DC 01:https://api-01.moengage.com/v1/campaigns/outbound/sms/callbacks/mo/twilio
- For DC 02: https://api-02.moengage.com/v1/campaigns/outbound/sms/callbacks/mo/twilio
- For DC 03:https://api-03.moengage.com/v1/campaigns/outbound/sms/callbacks/mo/twilio
- For DC 04:https://api-04.moengage.com/v1/campaigns/outbound/sms/callbacks/mo/twilio
Note that this field is only available when the Manage keyword based responses toggle under Keyword management is enabled.
SMS unsubscribe text
The input text provided in this field appears when you select the SMS opt-out instruction checkbox while creating content for your SMS campaign.
The SMS opt-out instruction allows you to include a text in the created SMS campaign that helps your customers to opt-out from receiving further SMS messages.
Note that this field is only available when the Manage keyword based responses toggle under Keyword management is enabled.
- Send a test SMS to verify your configuration.
- Click Save to save the Sender Configuration.
- You can also check your account balance by clicking Check balance.
Configure in Old UI
- Go to Settings -> SMS & Connectors -> SMS Connector Config.
- Select Twilio under Integrated Connectors.
- You will see the Twilio configuration page below.
- Next, in the pop-up, enter the authentication details. You can find these details in your Twilio console once you log in to your Twilio account.
-
-
Username: This is the Twilio Account SID.
Password: This is the Twilio Auth Token.
Twilio Console:
-
After entering the Twilio Account SID & Auth token, click on Save to save the authentication details. The authentication for Twilio is at the account level, and you do not need to add this for each sender. However, for any reason, if you need to change the authentication parameters, you can click on the gear icon next to Twilio and change the settings.
-
Username: This is the Twilio Account SID.
-
- After saving the authentication details, you will see the updated Twilio configuration page with the option to add senders.
-
Enter the following details:
-
-
Sender Name
Add any name to identify the Twilio sender -
Sender Type
Choose the correct sender type from the dropdown. We support sending via Longcode, Shorcode, Service plan ID, or Alphanumeric sender ID. Make sure that the sender type you choose is supported in the country/region in which you want to target your users with the SMS campaign. Also, the same sender type should be configured in your Twilio console. If not, then reach out to the Twilio team to get the necessary action done. -
Sender ID
This is the number from which SMS will be sent to your users. Make sure to add the number corresponding to the type you chose. Refer to ShortCode, LongCodes, and Messaging Services for more information. Enter the Messaging Service SID in the Sender ID field. -
Mobile Originated (MO) callback URL
This callback URL depends on the data center (DC) to which your workspace belongs. The callback URLs are listed below:
- For DC 01:https://api-01.moengage.com/v1/campaigns/outbound/sms/callbacks/mo/twilio
- For DC 02: https://api-02.moengage.com/v1/campaigns/outbound/sms/callbacks/mo/twilio
- For DC 03:https://api-03.moengage.com/v1/campaigns/outbound/sms/callbacks/mo/twilio
- For DC 04:https://api-04.moengage.com/v1/campaigns/outbound/sms/callbacks/mo/twilio
Note that this field is only available when the Manage keyword based responses toggle under Keyword management is enabled.
-
SMS unsubscribe text
The input text provided in this field appears when you select the SMS opt-out instruction checkbox while creating content for your SMS campaign.
The SMS opt-out instruction allows you to include a text in the created SMS campaign that helps your customers to opt-out from receiving further SMS messages.
Note that this field is only available when the Manage keyword based responses toggle under Keyword management is enabled.
-
Sender Name
-
- Do a test SMS to ensure everything is set up correctly. And finally, click Save to save the configuration.
Delivery Callback
For long code and short code, delivery receipts will be automatically tracked by MoEngage as we pass the delivery callback URL in the API call to Twilio. You don't have to do any additional configuration for tracking the SMS delivery.
For Messaging Services, you need to add the Delivery Callback URL in the Twilio dashboard for each messaging service. To do this, log in to your Twilio Dashboard and go to Messaging >> Services. Select a Messaging service.
You will see a different menu on the left panel. Click on the Integration tab under the Messaging service name. Scroll to Delivery Status Callback and enter the Callback URL - https://api-01.moengage.com/sms/dlr/twilio
Configure Keyword Management
Changes in MoEngage Settings
To configure keyword management, you need to input the below two fields in the Sender Details screen of the MoEngage dashboard. These fields appear only when the Manage keyword-based responses toggle under Keyword management is enabled.
-
Mobile Originated (MO) callback URL - This callback URL depends on the DC you belong to. The callback URLs are listed below:
- For DC 01-https://api-01.moengage.com/v1/campaigns/outbound/sms/callbacks/mo/twilio
- For DC 02-https://api-02.moengage.com/v1/campaigns/outbound/sms/callbacks/mo/twilio
- For DC 03-https://api-03.moengage.com/v1/campaigns/outbound/sms/callbacks/mo/twilio
- For DC 04-https://api-04.moengage.com/v1/campaigns/outbound/sms/callbacks/mo/twilio
- SMS unsubscribe text- The SMS unsubscribe text allows you to include a text in the created SMS campaign that helps your customers opt-out from further SMS messages. The input text provided in this field is displayed as an opt-out text when you select SMS opt-out instruction checkbox while creating content for your SMS campaign.
Changes in Twilio Console
For any configured sender, perform the following steps to configure key management in the Twilio console:
- Log in to Twilio console.
- Navigate to the messaging service that needs to be configured, and click Integration.
- Under Incoming Messages, select Send a webhook.
- In the Request URL field, enter the same callback URL you added in the Mobile Originated (MO) callback URL field of the MoEngage dashboard.
- Select the method as HTTP Get.
Next Steps
- Create an SMS campaign using the Getting Started for creating SMS campaign.
- Set the Frequency Capping for SMS.
- Set the Current Service Provider.