curl -X POST "https://app.sendx.io/rest/email" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"from": {
"email": "support@example.com"
},
"to": [
{
"email": "user@example.com",
"customFields": {
"order_id": "A12345",
"vip": "true"
}
}
],
"subject": "Your SendX Order Confirmation",
"htmlBody": "<p>Hi Jane, your <strong>order {{order_id}}</strong> has been confirmed!</p><p>Unsubscribe <a href=\"{{unsubscribe}}\">here</a>.</p>",
"textBody": "Hi Jane, your order {{order_id}} has been confirmed! Unsubscribe: {{unsubscribe}}",
"headers": {
"X-Campaign": "order-confirmation",
"List-ID": "list-orders"
},
"trackClicks": true,
"trackOpens": true
}'