vestnik_notify snippet

Vestnik1 min readPage 4 of 12

Queues emails by the rules of your own event — for events that are not among the system ones. Call it uncached.

[[!vestnik_notify? &event=`order.paid` &email=`[[+email]]` &data=`{"order_id":"105","fullname":"John"}`]]
ParameterDescription
&eventEvent key, required. Any name (order.paid, feedback.sent) — it must match the “Event key” of an active rule.
&emailRecipient address for the “Event user” strategy (stored in the data as email).
&dataJSON with template data: each key becomes a [[+key]] placeholder.
&sourcemanual (default) or component — a label for OnVestnikBeforeQueue and the debug log.
&showCount1 — output the number of queued emails. By default the snippet outputs nothing.

The event name does nothing by itself: first create a rule with this key, a template and a recipient, then call the snippet.

Attachments cannot be passed through the snippet: the attachments key in &data is skipped (with a warning in the log) — a visitor could otherwise pass a path to a server file. Attachments only from code, see Attachments.

If the JSON in &data is invalid, no email is created and the reason is written to the MODX error log.