Preview: SendMock has no stable release yet. These docs follow develop.
SendMock
Webhooks

Variables

Values templates read as vars.name. Fixed values, secrets, values from the message, random values, combinations and values asked for at send time.

Try it in the demo.

Templates read variables as {{ vars.name }}. They hold what a template needs that is not in the event: an auth token for a signature, a tenant id, a chat id, a fresh random id per send.

The Variables screen

What it solves

  • A provider signature needs your app's real auth token (Twilio's X-Twilio-Signature), and it must never show on screen or in exports.
  • Each request needs a fresh id or nonce, or a value copied from the message (the first recipient, lowercased).
  • One template serves several endpoints that differ only in a value.

How it connects

Gets fromSends to
you, the seed file, or Missing prompts on an endpointtemplates, endpoint URLs and headers, catcher responses
the event, for Dynamic variablesSend to webhook and the Composer, which ask for Prompt variables

Use it

  1. Press Add variable.
  2. Name it tenant_id, keep Global, pick Text and enter acme.
  3. The sheet shows what it resolves to. Press Add variable.
  4. Use it in a template or header as {{ vars.tenant_id }}.

Everything on this screen

The table

Every global and endpoint variable: name (as vars.name), kind, value (secrets masked; the expression for Dynamic, Random and Computed; the current value of a fixed Random), scope (Global or the endpoint) and description. Filters: scope (also ?endpoint=), kind chips and a name search. Row actions: Edit, Delete, and Regenerate for fixed Random variables.

Kinds

KindValueExample
Text, Number, Boolean, JSONa fixed value, checked for its typeacme, 3, true, {"plan": "pro"}
Secreta fixed value, masked everywhere, never shown again after saving, never exported in plain textan auth token
Dynamica path or expression over the eventdata.to[0].address | lower
Randoma generator, Per send or Fixed (generated once until you press Regenerate)random_string(16)
Computeda template made of other variables{{ vars.tenant_id }}-{{ vars.nonce }}
Prompta default value; manual sends ask for it, automatic sends use the defaulta customer id to try

Scope

A variable is Global or belongs to one endpoint. An endpoint's variable wins over a global one of the same name, and a send-time override wins over both.

Every control and text, one by one: Variables in depth.

Customize

Dynamic expressions, generators, computed values and send-time overrides in depth: Advanced: variables.

From the CLI, API and AI

On this page