Variables¶
Template variables allow you to personalize message content by injecting dynamic recipient attributes, transactional details, order metadata, and security PIN codes into message templates and campaigns at runtime.
By defining standard and custom variables in Abelo, you can build unified templates that dynamically adapt to each individual recipient.
1. Overview¶
Abelo uses liquid-style variable placeholders enclosed in double curly brackets:
"Hi {{first_name}}, your order #{{order_number}} has shipped! Track it here: https://carrier.com/track/{{tracking_code}}"
When a campaign is triggered or dispatched:
- Abelo inspects the template text for all
{{variable_code}}tokens. - The platform matches each token against the recipient's profile data or the parameters passed in an API payload.
- The placeholder is replaced with the recipient's actual value before transmission to the messaging network.
2. Standard & System Variables¶
Abelo provides standard variable keys commonly used for profile personalization and security workflows:
Standard Profile Variables¶
These variables automatically resolve to the recipient's saved profile attributes:
| Variable Code | Description | Sample Output |
|---|---|---|
{{first_name}} |
Recipient's first name. | Alex |
{{last_name}} |
Recipient's last name. | Papadopoulos |
{{phone_number}} |
Recipient's normalized phone number. | +306912345678 |
{{email}} |
Recipient's email address. | alex@example.com |
Special System Variables¶
| Variable Code | Category | Purpose |
|---|---|---|
{{pin}} |
OTP | Mandatory parameter for OTP templates. Injected dynamically with the generated verification PIN or authentication passcode. Cannot be deleted or modified. |
3. Custom Transactional Variables¶
For transactional notifications and order events triggered via the Abelo API, you can define custom variables that correspond directly to fields in your backend database, e.g.:
| Variable Code | Usage Scenario | Example Value |
|---|---|---|
{{order_number}} |
Order confirmations and shipping alerts | 10842 |
{{tracking_code}} |
Courier parcel tracking reference | TR99281 |
{{total_amount}} |
Payment receipts and checkout summaries | €84.50 |
{{delivery_date}} |
Logistics and appointment reminders | Friday, Oct 10 |
{{discount_code}} |
Promotional vouchers and cart recovery | WELCOME10 |
4. Formatting Links & URLs with Variables¶
To ensure message security and comply with Rakuten Viber compliance guidelines, variable values must never contain full URLs, domain names, or protocol schemes.
Instead, construct dynamic links by defining the static, verified destination domain in the template text and using variables strictly for dynamic path or query parameters:
- ✅ Supported & Recommended:
https://carrier.com/track/{{tracking_code}}https://myshop.gr/orders/{{order_id}}?lang=el- ❌ Prohibited & Rejected:
https://{{domain}}/track/123(Protocol scheme followed directly by a placeholder)www.{{host}}/orders(Dynamic base host)- Passing
"https://carrier.com/track/123"insidetracking_code(Variable value contains a URL)
5. Fallback Values¶
To handle situations where an audience profile may lack a specific attribute (e.g., an unpopulated first name), Abelo supports liquid fallback syntax using the pipe operator:
- When
first_nameexists:Hello Alex, your cart is waiting for you! - When
first_nameis blank or null:Hello there, your cart is waiting for you!
6. Using Variables in API Payloads¶
When triggering an API campaign from your backend, pass your template variables as key-value pairs inside the params object:
{
"campaign_id": "camp_order_shipped_01",
"recipient": {
"type": "phone_number",
"value": "+306912345678"
},
"params": {
"first_name": "Alex",
"order_number": "10842",
"tracking_code": "TR99281"
}
}
Template definition:
Hi {{first_name}}, your order #{{order_number}} is on its way! Track your package here: https://carrier.com/track/{{tracking_code}}
Resulting message delivered to recipient:
Hi Alex, your order #10842 is on its way! Track your package here: https://carrier.com/track/TR99281
For more information on how to use variables in API triggered campaigns, see Triggering API Campaigns.
7. Creating a Variable¶
Follow these steps to define a new template variable in Abelo:
- Navigate to Templates > Variables in the main sidebar.
- Click Create New Template Variable.
- Complete the parameter definition fields:
- Name: Enter a descriptive name for the variable (up to 125 characters, e.g., Tracking Code).
- Code: Enter the exact parameter key (up to 50 characters).
- Must consist of English letters, digits, hyphens, and underscores only (
^[a-zA-Z0-9_-]+$). - Spaces are automatically converted to underscores (
_). - This code must match the key passed in your backend API payload or profile schema.
- Must consist of English letters, digits, hyphens, and underscores only (
- Example Value: Provide a representative sample value (mandatory, 1 to 125 characters, e.g., TR99281).
- Must not be empty: Used for moderation submissions to Viber and live message previews.
- Must not contain URLs or links: URLs, domain names (with valid IANA TLDs), IP addresses, and custom schemes (
viber:,tel:) are strictly prohibited.
- Click Save to register the variable.
8. Viewing and Managing Variables¶
The Variables overview table displays all configured template variables registered for your organization:
- Name: Human-readable label for the variable (e.g., Customer First Name, Order Number).
- Code: Exact parameter key used in templates and API payloads (e.g.,
first_name,order_number). - Example Value: Sample value used to render realistic previews in template and campaign editors (e.g., Alex, ORD-10492).
- Actions:
- Delete Variable: Permanently remove the variable. A confirmation dialog prevents accidental deletion.
Deleting Active Variables
Before deleting a template variable, verify that it is not actively referenced in any approved Viber templates, SMS templates, or active API campaign triggers. Abelo actively blocks the deletion of any variable that is in use by an active template.