SMS Templates
All SMS sent in India must use DLT-approved templates as mandated by TRAI. This guide explains how to create, register, and manage SMS templates for use with Exotel.
What Are SMS Templates?​
SMS templates are pre-approved message formats registered on a DLT (Distributed Ledger Technology) portal. Each template has:
- A Template ID -- Unique identifier assigned by the DLT portal after approval.
- A Template Name -- A descriptive label for your reference.
- A Message Body -- The message text with optional variable placeholders.
- A Template Type -- Transactional, promotional, or service.
- A Sender ID (Header) -- The sender identity linked to the template.
Template Types​
| Type | Code | Description | Example |
|---|---|---|---|
| Transactional | T | Time-sensitive alerts, OTPs, order updates | "Your OTP is {#var#}. Valid for 10 minutes." |
| Promotional | P | Marketing, offers, discounts | "Flat {#var#}% off on all products! Shop now at {#var#}" |
| Service Implicit | SI | Service messages to existing customers | "Dear {#var#}, your bill of Rs. {#var#} is due on {#var#}." |
| Service Explicit | SE | Service messages with explicit opt-in | "Hi {#var#}, based on your interest, check out our new plan at {#var#}" |
Creating a Template​
Step 1: Log in to Your DLT Portal​
Access your DLT portal account. Common portals include:
| Operator | Portal URL |
|---|---|
| Jio | https://trueconnect.jio.com |
| Airtel | https://www.airtel.in/business/commercial-communication |
| Vodafone-Idea | https://www.vilpower.in |
| BSNL | https://www.ucc-bsnl.co.in |
| MTNL | https://www.ucc-mtnl.in |
| Smartping (Videocon) | https://smartping.live |
Step 2: Navigate to Template Registration​
- Go to Templates or Content Template section.
- Click Add New Template or Register Template.
Step 3: Fill in Template Details​
| Field | Description | Example |
|---|---|---|
| Template Name | Descriptive name for identification | order_otp_verification |
| Template Type | Select the category | Transactional |
| Content Type | Text or Unicode | Text |
| Header (Sender ID) | Select your registered header | EXOTL |
| Template Content | Message body with variables | Your OTP for order {#var#} is {#var#}. Do not share this with anyone. |
Step 4: Variable Placeholders​
Use {#var#} as placeholders for dynamic content in your templates:
Dear {#var#}, your order #{#var#} has been shipped via {#var#}.
Track at {#var#}. Delivery expected by {#var#}.
Each {#var#} placeholder can be replaced with any value when sending the SMS. The DLT system validates that the static portions of your message match the template.
Step 5: Submit for Approval​
- Review the template carefully.
- Click Submit to send it for approval.
- Approval typically takes 1-3 business days.
- Once approved, note the Template ID for use with Exotel.
Using Templates with Exotel​
In the Dashboard​
- Go to App Bazaar > SMS > Send SMS.
- Select your sender ID.
- Choose an approved template from the dropdown.
- Fill in the variable values.
- Send the message.
Via the API​
Pass the DltTemplateId parameter when sending SMS through the Send SMS API:
curl -X POST "https://<api_key>:<api_token>@api.exotel.com/v1/Accounts/<account_sid>/Sms/send" \
-d "From=EXOTL" \
-d "To=+919876543210" \
-d "Body=Your OTP for order ORD123 is 456789. Do not share this with anyone." \
-d "DltEntityId=1234567890123" \
-d "DltTemplateId=1107160000000012345"
The message body sent via the API must exactly match the approved template structure. Only the {#var#} placeholders can be replaced with actual values. Any mismatch will result in a FAILED_DLT_TEMPLATE error.
Template Best Practices​
- Keep templates concise -- SMS has a 160-character limit for plain text (70 for Unicode). Longer messages are sent as multi-part SMS and cost more.
- Use meaningful names -- Name templates descriptively (e.g.,
otp_login,order_shipped) for easy identification. - Minimize variables -- Use only necessary variable placeholders. Too many variables may cause template rejection.
- Include opt-out -- For promotional templates, include opt-out instructions (e.g., "Reply STOP to unsubscribe").
- Avoid special characters -- Stick to standard ASCII characters in plain-text templates to avoid encoding issues.
- Test before production -- Always test templates with sample data before using in production.
Managing Templates​
Viewing Templates​
- DLT Portal: Log in to your DLT portal to see all registered templates and their approval status.
- Exotel Dashboard: View mapped templates in the SMS configuration section.
Template Statuses​
| Status | Description |
|---|---|
Pending | Template submitted, awaiting approval |
Approved | Template approved and ready to use |
Rejected | Template rejected; review and resubmit |
Blacklisted | Template blocked due to policy violations |
Deactivated | Template manually disabled |
Updating a Template​
DLT portals generally do not allow editing approved templates. To modify a template:
- Create a new template with the updated content.
- Submit the new template for approval.
- Once approved, update your application to use the new template ID.
- Optionally, deactivate the old template.
Common Template Errors​
| Error | Cause | Resolution |
|---|---|---|
FAILED_DLT_TEMPLATE | Message body does not match the template | Ensure exact match with approved template, replacing only {#var#} placeholders |
FAILED_DLT_SCRUBBING | Template not found in DLT registry | Verify the template ID and ensure it is approved on your DLT portal |
| Template Rejected | Content violates DLT guidelines | Review DLT content guidelines and resubmit with compliant content |
Next Steps​
- Sender ID -- Register your sender ID
- DLT Registration -- Complete DLT setup
- How to Send SMS -- Send your first message
- SMS API Reference -- API documentation