"jsonnet".
When to use:
- Generate dynamic JSON structures based on data
- Create reusable template logic with functions and variables
- Build complex nested objects programmatically
- Avoid repetitive JSON structures
- Generate locale-specific content programmatically
string
required
The Jsonnet template code. A string of valid Jsonnet, evaluated to produce JSON. The template reaches message data through Jsonnet’s standard variable access.
object
Region-specific Jsonnet templates. Keys are locale codes (e.g.,
"es", "fr"), and each value is the Jsonnet template for that locale. See the .string[]
An array of channel names. The Jsonnet element renders only for the listed channels. See .
- Variables:
local name = "Sarah Bennett"; - Functions:
local greet(name) = "Hello " + name; - Object composition: Merge objects with
+ - Conditionals:
if condition then value1 else value2 - Loops:
[x * 2 for x in [1, 2, 3]] - Imports:
local lib = import "lib.jsonnet";
For complete Jsonnet language documentation, see the official Jsonnet documentation.
- Email: ✅ Full support
- Push: ✅ Supported (JSON output can be used in push payloads)
- SMS: ⚠️ Limited support (JSON output may need to be stringified)
- Inbox: ✅ Full support