Token Types - Messaging
Token Types
Tokens are placeholders in the template subject, body, and fromName that get replaced with actual values at send time. Define tokens in msgParamsMap and reference them in the template.
Token reference syntax:
- User tokens:
{tokenName.fieldName}(e.g.,{recipient.firstName}) - All other tokens:
{tokenName}(e.g.,{eventLink})
4.1 Available Token Types
| Type | Description | Value at Send Time |
|---|---|---|
User | Kaltura user profile fields | User ID or "Message.userId" (auto-resolves from recipient) |
String | Static text replacement | Any string value |
MagicLink | Auto-login URL with embedded auth token | Object: {baseURL, expiry, privileges} |
Dynamic | Type decided at send time | Resolved as String or MagicLink based on the value provided |
UnsubscribeUri | CAN-SPAM unsubscribe link | URI string |
JwtQrCode | QR code image with embedded JWT | Object: {payload, secret, options?} |
4.2 User Token Fields
When using a User type token, these fields are available from the Kaltura user record:
id, partnerId, externalId, firstName, lastName, email, fullName, screenName, dateOfBirth, gender, thumbnailUrl, description, title, country, company, state, city, zip
4.3 MagicLink Value Structure
{
"baseURL": "https://events.example.com/join",
"expiry": 24,
"privileges": "actionslimit:2"
}
| Field | Type | Description |
|---|---|---|
baseURL | string | Base URL for the magic link |
expiry | integer | Link expiry in hours |
privileges | string | KS privileges for the generated session |
4.4 JwtQrCode Value Structure
{
"payload": {"eventId": "12345", "checkIn": true},
"secret": "your-jwt-secret",
"options": {"color": {"dark": "#000000"}}
}
| Field | Type | Required | Description |
|---|---|---|---|
payload | object | Yes | JWT payload data (key-value pairs) |
secret | string | Yes | Secret for JWT signing |
options | object | No | QR code rendering options (color settings) |