Update wiki
This commit is contained in:
@@ -148,13 +148,15 @@ Access nested objects with dot notation:
|
||||
|
||||
### Transactional emails
|
||||
|
||||
Use the `template` field with the **template ID** (not the template name):
|
||||
|
||||
```bash
|
||||
curl -X POST {{API_URL}}/v1/send \
|
||||
-H "Authorization: Bearer sk_your_secret_key" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"to": "[email protected]",
|
||||
"template": "order-confirmation",
|
||||
"template": "clx123abc456",
|
||||
"data": {
|
||||
"orderNumber": "12345",
|
||||
"deliveryDate": "March 20"
|
||||
@@ -162,6 +164,35 @@ curl -X POST {{API_URL}}/v1/send \
|
||||
}'
|
||||
```
|
||||
|
||||
**Finding your template ID:**
|
||||
- In the dashboard: Go to Templates → Click on your template → Copy the ID from the URL or template details
|
||||
- Via API: Use `GET /templates` to list all templates with their IDs
|
||||
|
||||
When using a template:
|
||||
- **Subject, body, from, and reply-to** are automatically taken from the template
|
||||
- **Template variables** (e.g., `{{orderNumber}}`) are populated from the `data` field
|
||||
- You can **override** any template value by explicitly providing it in the request (see example below)
|
||||
|
||||
### Overriding template values
|
||||
|
||||
```bash
|
||||
curl -X POST {{API_URL}}/v1/send \
|
||||
-H "Authorization: Bearer sk_your_secret_key" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"to": "[email protected]",
|
||||
"template": "clx123abc456",
|
||||
"subject": "Custom Subject (overrides template)",
|
||||
"from": {
|
||||
"name": "Custom Sender",
|
||||
"email": "[email protected]"
|
||||
},
|
||||
"data": {
|
||||
"orderNumber": "12345"
|
||||
}
|
||||
}'
|
||||
```
|
||||
|
||||
### In workflows
|
||||
|
||||
When creating a **Send Email** workflow step, select the template from the dropdown. Variables are automatically filled from contact data and workflow context.
|
||||
|
||||
Reference in New Issue
Block a user