Message Templates
Message Templates define the content of automated messages sent to guests — welcome emails, SMS OTP codes, voucher delivery, account creation notifications, password resets, and expiry reminders. Each template is tied to a channel type and a trigger event.
'alt' => 'Dashboard overview', 'caption' => 'The default Kiwire dashboard layout', 'screenshot' => true, 'class' => '', ]) Drop images into: public/assets/img/docs/{page}/{filename} --}}public/assets/img/docs/message-template/overview.png
Template Types
Each template belongs to one of three delivery channels:
| Type | Connector Required | Body Format |
|---|---|---|
email | SMTP Connector | Full HTML (rich formatting via Quill editor) |
sms | SMS Connector | Plain text (character counter shown) |
whatsapp | WhatsApp Connector | Plain text with WhatsApp formatting support (*bold*, _italic_) |
A template is only active if its required connector is configured and enabled. If the SMTP connector is not set up, email templates exist but messages will not be sent when triggered.
Trigger Events
Each template is associated with a specific event that triggers it automatically. The system dispatches messages when these events occur:
| Event | When It Fires | Common Channels |
|---|---|---|
welcome | Immediately after a new guest account is created | Email, SMS, WhatsApp |
otp | When a guest requests an OTP code during SMS or WhatsApp login | SMS, WhatsApp |
voucher | When a voucher code is assigned or purchased by a guest | Email, SMS |
topup | When a top-up code is successfully redeemed | Email, SMS |
reset_password | When a guest requests a password reset from the portal login page | |
account_expiry | Sent N days before the guest's account expiry date (configured in Settings) | Email, SMS |
Template Fields
| Field | Description |
|---|---|
name | Internal label for this template. Not visible to guests. |
type | Delivery channel: email, sms, or whatsapp. |
event | The trigger event this template handles. Only one active template per event per channel is used. |
subject | Email subject line. Email only — not applicable for SMS or WhatsApp. |
body | Message content. HTML for email (Quill editor), plain text for SMS/WhatsApp. |
is_active | Enable or disable this template. If disabled, no message is sent for this event on this channel. |
Template Variables
Insert dynamic values into your template body or subject using double-brace variables. These are resolved at the time of sending and replaced with actual guest data.
| Variable | Replaced with | Available in |
|---|---|---|
{{username}} | The guest's username | All events |
{{fullname}} | The guest's full name | All events |
{{email}} | The guest's email address | All events |
{{password}} | The generated or reset password (plain text) | welcome, reset_password |
{{otp}} | The one-time password code | otp |
{{code}} | Voucher or top-up code | voucher, topup |
{{expiry}} | Account expiry date and time | All events |
{{tenant_name}} | Your organisation's name (tenant display name) | All events |
{{reset_link}} | The clickable password reset URL | reset_password |
{{profile_name}} | The access profile name assigned to the guest | welcome, topup, voucher |
Using a variable that is not available for the triggered event (e.g., {{otp}} in a welcome template) will result in an empty string being inserted. Always match variables to their appropriate events.
Email Editor (HTML)
Email templates use the Quill rich text editor. You can:
- Apply headings, bold, italic, underline, and strikethrough formatting
- Insert hyperlinks and images (images must be hosted URLs — inline base64 is not supported)
- Create ordered and unordered lists
- Set text colour and background colour
- Switch to HTML source view to paste or write raw HTML directly
For best email deliverability and rendering across all email clients, keep your HTML simple. Avoid complex CSS, JavaScript, and multi-column grid layouts — use basic tables for multi-column structure if needed.
SMS & WhatsApp Editor (Plain Text)
SMS and WhatsApp templates use a plain-text editor with a live character counter displayed below the field. For SMS:
- Standard GSM-7 encoding: 160 characters per single SMS segment
- Messages longer than 160 characters are split into multi-part SMS (each segment billed separately)
- Using non-GSM characters (e.g., emoji, certain accented characters) reduces the per-segment limit to 70 characters
WhatsApp templates support basic formatting: wrap text in *asterisks* for bold, _underscores_ for italic, and ~tildes~ for strikethrough.
Template Preview
Click Preview from the template action menu to render the template with sample data substituted for all variables. The preview opens in a modal and shows the email in a styled frame (for email type) or as plain text (for SMS/WhatsApp).
The preview uses placeholder values such as John Doe for {{fullname}} and 123456 for {{otp}} — this is for visual review only, no message is actually sent.
Multiple Templates per Event
You can create multiple templates for the same event and channel. Only the first active template for each event+channel combination is used. If you want to test a new template design, create it as inactive, then swap the active flags when ready.
Required Permissions
view-message-templates · create-message-templates · update-message-templates · delete-message-templates