How Targets work
- A Reaction fires on an event
- The Reaction’s
target.sendaction is executed - The Target retrieves the event context data
- The Twig template is rendered using the context data
- The rendered JSON is sent as an HTTP POST to the Target’s configured URL
Target fields
| Field | Description |
|---|---|
name | Display name for the target |
handle | Machine-readable identifier referenced in reaction actions |
url | The endpoint that receives the payload |
template | A Twig-templated JSON string |
description | Optional description |
notes | Optional implementation notes |
Twig templates
Target templates use the Twig templating engine. All fields available in the Event Context can be referenced using{{ variable_name }} syntax.
Example template for a reward issuance notification:
profile.update, so profile fields are accessed at the root level.
Context levels
Data in the Event Context is available at different nesting levels:- Level 1: Root profile fields:
{{ first_name }},{{ email }},{{ tier_handle }} - Level 2: Nested objects:
{{ aggregations.spend_12m }},{{ tier.name }} - Level 3: Deeply nested:
{{ attributes.comms.email_promo }}
Common Target use cases
- Sending a reward issuance email payload to Klaviyo
- Triggering a tier upgrade flow in Salesforce Marketing Cloud
- Posting a new member notification to a Slack channel
- Calling a cloud function to sync data to a data warehouse
Configuring Targets
Targets are managed in CX Manager under Settings → Targets, or via the Targets API. Each target must be referenced by itshandle in the target.send reaction action argument.
See Dev Guides: Targets in Reactions for a full walkthrough.