Sending Text Messages
- API Integration
Case Studies A - G
- About Us
In this video tutorial, we will show you how to create & edit templates in a transactional account and also, use them to send messages via UI/API. Using Textlocal, you can easily send media rich personalized messages with files, web links, mobile web pages, tickets and surveys. What's more, our SMS API receives delivery receipts, schedules messages & pulls results from mobile forms & surveys into your app!
From a transactional account, you can send only messages that match one of your pre-approved templates.
In this video, we’ll show you how to add and edit templates and also, use them to send messages via Textlocal Messenger and APIs.
Templates can be broadly classified into two categories: static and dynamic.
· A static template is used when the same message needs to be sent to all the recipients. These messages generally include group notifications such as school closures or service downtimes.
· A dynamic template is used when the message differs for every recipient. These messages generally include OTPs, order updates and banking alerts.
Let’s now see how to add a static template:
- Login to your account and select ‘Templates & Drafts’ under the Send Tab.
- Click on ‘Request new template’ button
- Give a ‘title’ to the new template. This only acts as an identifier and won’t be a part of the message content or API request.
- Select one of the pre-approved sender IDs.
- Enter your message content along with any attachments, shortlinks or surveys and request for the new template.
- This template will now be reviewed and approved by us within a couple of business hours. You can check the approval status of all your templates in the ‘Templates & Drafts’ page.
Let’s now see how to add dynamic parameters in a template:
Whenever you need to place a dynamic parameter in your template, click on ‘Insert restricted template items’ and select ‘Insert an input box’.
- Specify the maximum character length and give a placeholder name for your dynamic parameter. Ensure that the placeholder names are unique and not repeated for any other parameters.
- Inserting dynamic parameters will result in HTML tags being added to your templates. These tags will not appear in the final message.
- If your dynamic parameter will be replaced by a limited set of values, you can also create a dropdown by clicking on ‘Insert a custom dropdown’.
- Give a unique title to the dropdown and add your options one-by-one. You can see all the added options in the preview dropdown.
- Add as many dynamic parameters as needed, draft the rest of your template and request for the new template. This template will now be reviewed and approved by us within a couple of business hours. You can check the approval status of all your templates in the ‘Templates & Drafts’ page.
If your Textlocal contact groups are uploaded along with any custom fields, you can also use ‘Insert Merge fields’ option to quickly send personalized messages.
―Just click on ‘Insert Merge fields’ while creating a template and add the custom fields you want to.
―Please note that these merge fields cannot be referenced in API.
―To know how to create Textlocal contact groups with custom fields, refer to our ‘How to create contacts’ video (link description in video).
To edit an approved template, just select the template in ‘Templates & Drafts’ page, make the edits and click on ‘Request New Template’
- Your edited template will now be placed under review. Please note that the approved current template can continue to be used as is.
Here are a few quick notes for API users:
- Transactional messages sent via Textlocal API will be sent only if it is an exact match with any of the pre-approved templates. So, ensure that the spaces, commas and periods follow the exact pattern
- Before calling the Textlocal API, ensure that your code replaces all the dynamic parameters with specific values corresponding to the recipient. You should call the Send API with the final message content
- Ensure that all the special characters are URL encoded
- Any newline characters in your template should be replaced with ‘ %n’
In case you encounter an invalid template error, perform these quick checks to ensure that the error is resolved-
• Ensure that the placeholder names are unique for every dynamic parameter and not repeated
• Ensure that you do not mention template titles or placeholder names in API code. They are only for internal reference
• Check if you’re exceeding the maximum character limit set for the placeholder
• Check if all special characters are URL encoded, especially the newline character
• Make sure that you do not reference Textlocal merge fields in API calls