1

I'm using braze API to send transactional emails. For now I'm triggering the sent manually using their API which works fine. But in this command below you see I'm sending a custom data in trigger_properties first_name. I'm unable for now to display it in the email (see the template below)

curl -X POST \
  -H 'Content-Type:application/json' \
  -d '{
    "campaign_id": "9854b86c-c185-3362-78a9-c442763bed9e",
    "trigger_properties": {
      "first_name":"First Name"
    },
    "broadcast": false,
    "recipients": [
      {
        "external_user_id": "xxxxx",
        "trigger_properties": {
          "first_name":"First Name"
        },
        "send_to_existing_only": false,
        "attributes": {
          "first_name": "xxxxx",
          "last_name": "xxxxx",
          "email": "xxxx@xxxx.com"
        }
      }
    ]
  }' \
  https://rest.fra-01.braze.eu/campaigns/trigger/send

A simple template:

Discover a new restaurant today{% if {{${first_name}}} == nil %}!{% else %}, {{${first_name}}}!{% endif %}
Melchia
  • 22,578
  • 22
  • 103
  • 117

1 Answers1

1

Ok I was able to find it. In the template the variable should be like this:

{{api_trigger_properties.${first_name} | default: 'there'}}
Melchia
  • 22,578
  • 22
  • 103
  • 117