Event triggers, website chat rules and campaigns
Message customers when something happens in your systems, greet website visitors at the right moment, and send one-off e-mails to a list.
Event triggers
Your systems send TR-AI an event — an order is late, a payment failed, a plan renews next week — with POST /v1/events (API key with the write scope). Every enabled trigger for that event whose conditions match fills in its message and sends it by e-mail, as a reply on the help-desk ticket (data.ticket_id), on SMS / WhatsApp / Messenger or in the website chat.
- Conditions compare fields of the event, e.g. data.delay_days ≥ 2 or customer.plan = pro. All conditions must match.
- Messages use {{customer.name}}, {{data.order_id}} and defaults like {{customer.name | there}}.
- “Wait for approval” puts messages in a queue on the Proactive page; “Send automatically” sends them at once.
- Send an Idempotency-Key header with every event; sending the same key again never sends a message twice.
Website chat rules
Show a short message next to the chat button when a visitor has been on a page for a while (e.g. pricing, 30 seconds) or moves to leave it. It appears once per visit and becomes the chat greeting if they open it.
Campaigns
Upload a CSV with an email column — every other column can be used as {{data.column}} — or choose everyone who opened a ticket recently. Preview the first messages, send yourself a test, then send. E-mails go out at the pace you set (per minute) and pause during quiet hours.
Rules that always apply
- Frequency caps per customer (default 1 a day and 3 a week) across triggers and campaigns.
- Quiet hours in your time zone: messages wait until they end.
- Every e-mail has an unsubscribe link; customers who unsubscribe or text STOP are never messaged again. You can add or remove opt-outs yourself.
- Every message is logged with its status and reason (sent, skipped because of a cap, opted out, rejected).
- No AI calls: messages are your templates filled in with the event data.
- Start triggers in “Wait for approval” for a week, then switch to automatic once the wording is right.
- Use the test box (Proactive → triggers) with a sample event to check which triggers match and what the message says.
- Keep campaign throttles low (30 a minute) for a new sending domain so mail providers trust it.