Language

Notification Events and the Template Variable Allowlist

Seven events each declare their usable variables, a token outside the list is refused when the channel is saved, and an empty template sends only the four envelope fields.

The notification centre does two and a half things: it delivers what happens on the site to a webhook or an email, and it lets you rewrite what the delivered text looks like. The boundary on the second one is not a layout question but a privacy question, so what this section is really describing is an allowlist.

The event catalogue has seven entries. Each event declares for itself which variables may appear in a template, and the lists look like this:

Event Display name Allowed variables (besides event/plugin/version/occurred_at)
security.alert.raised Security anomaly data.id、data.category、data.severity
security.alert.recovered Security anomaly recovered data.id、data.category、data.severity
lead.created Lead created data.id、data.email
content.published Content published data.id、data.slug、data.status
form.submitted Form submitted data.id、data.form_slug、data.email、data.message
assistant.handoff.requested Visitor asks for a human data.id、data.status、data.unread_for_agent、data.visitor_language、data.waiting_seconds、data.reason
assistant.handoff.waiting Handover with nobody answering same as above

This list takes effect when the channel is saved, not by silently dropping text at delivery time. A {{data.some_key}} in the template that is not on the list makes the save itself fail, telling you which token is not allowed. That ordering is deliberate: filtering only at delivery time would let a template containing a visitor's message text be created successfully, then quietly send nothing in production while operations believed it was configured.

When one channel subscribes to several events, the usable variables are the intersection. The list has to satisfy every event this channel subscribes to; if a single event does not carry that variable, the sentence cannot be filled for that event, so the whole template is refused. That is more honest than "allow the widest event and leave the others blank", because it keeps the failure at the moment of saving.

The two handover events deliberately carry no message text, no name, no contact details and no source address. Conversation content is visible in the console in tiers based on "am I the one handling this conversation"; copying the same content into an external webhook would create a second copy outside this product's access control that nobody is responsible for reclaiming. And what "someone is waiting" needs is exactly: which conversation, what status, how long it has waited, and which language the visitor is using. The form-submission event does allow email and message text, because that is precisely where a lead notification's value lies — something that only goes out if the channel author explicitly wrote it into the template.

Leaving the template empty does not mean "send the whole event". With an empty template, the delivery contains only the four envelope fields: event name, source plugin, version, and the moment it occurred. Want content, write a template; write a template, and the list applies. One earlier implementation serialised the entire event for an empty template, at which point every field of a form submission bypassed the allowlist — that has been fixed.

There is exactly one place that renders. "Test this channel" and real delivery use the same render function with the same data; the old pattern of rendering once and then rendering again on send would give the second pass an event with no content, producing "the test passed but real deliveries are empty", or the reverse.

A delivery failure records a category, not the original text. Every error passes through one masking function before it is stored, which removes the address as written, the request URI, and both forms of a password (decoded and URL-encoded). The delivery record page is readable by anyone in the console, so it cannot be used as a debugging buffer.

One more thing that is easy to miss: events go through the kernel's reliable delivery queue, so an agent being offline or a WebSocket dropping does not stop the reminder. "Handover with nobody answering" repeats on a threshold and has a cap on the number of attempts — a conversation delivered for the thirteenth time carries the same information as the first, which only trains the recipient to ignore it. The threshold is changed on the customer-service screen for handover waiting and timeouts, where 0 turns the rule off; the attempt cap is a fixed value and is not configurable.