SMS Templates
Save reusable message templates for quick SMS composition.
Overview
Templates let you save frequently used message text so you don't have to type it from scratch every time. Create templates for verification codes, appointment reminders, shipping notifications, or any other recurring message pattern.
Templates are managed through the Templates page in the dashboard and can be selected when composing messages in the Send SMS dialog or when creating scheduled messages.
Creating templates
- Navigate to Templates in the sidebar
- Click Add Template
- Enter a name (e.g., "Verification Code") and the body text
- Click Create Template
Template bodies support up to 1,600 characters, matching the SMS body limit.
Variables
Templates support {{variable}} placeholders that are replaced at send time.
This enables personalized messages for each recipient.
Reserved variables
These variables are auto-filled from your contacts — you don't need to provide them:
| Variable | Source | Description |
|---|---|---|
{{name}} | Contact name | Filled from the contact matching the recipient's phone number |
{{phone}} | Contact phone | The recipient's phone number |
If a recipient is not in your contacts, reserved variables remain as literal text
(e.g., {{name}} stays unchanged).
Custom variables
Any other {{variable_name}} is a custom variable that you provide when sending.
For example, a template like:
Hi {{name}}, your verification code is {{code}}. It expires in {{minutes}} minutes.
Has one reserved variable (name) and two custom variables (code, minutes)
that must be provided at send time.
Using templates
In the dashboard
Templates appear in two places:
- Send SMS dialog — Select a template from the dropdown. A preview of the template body is shown, and input fields appear for any custom variables. Reserved variables are filled automatically from your contacts.
- Schedule SMS dialog — Same template picker is available when creating scheduled messages (copies the template text to the body field for editing).
Via API
Use the POST /api/sms/send-template endpoint
or the SDK template methods to send SMS using templates programmatically.
API access
Templates are stored in the sms_templates collection and can be managed via the PocketBase collections API. All operations are scoped to the authenticated user.
List templates
GET /api/collections/sms_templates/records
Create a template
POST /api/collections/sms_templates/records
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Template name (max 100 characters) |
body | string | Yes | Message text (max 1600 characters) |
user | string | Yes | User ID (set automatically in dashboard) |
Update a template
PATCH /api/collections/sms_templates/records/:id
Delete a template
DELETE /api/collections/sms_templates/records/:id
Related
- Scheduled SMS - Use templates with scheduled messages
- Send SMS - Send messages via API