Personalization and filters
Write {{first_name}} in an issue, store custom fields, track events, send to a saved filter.
Tags in the subject, preheader and body are filled for each recipient when the issue is sent: {{first_name}}, {{last_name}}, {{name}}, {{email}}, {{language}} and {{custom.<key>}} for your custom fields.
{{first_name | default: "there"}}— the fallback when the contact has no value (also what the public archive shows).upper,lower,capitalizechange the case:{{first_name | capitalize}}. Filters chain left to right.- No loops, no conditions. A tag the engine does not know stays as typed.
- Values are HTML-escaped.
{{first_name}}falls back to the first word ofnamefor contacts imported with a full name only.
Custom fields
Create the field first (POST /contact-fields: key, label, type among text, number, date, boolean, choice), then write values with custom_fields on POST /contacts, POST /contacts/import or PATCH /contacts/{id}. Dates are YYYY-MM-DD. 50 fields per workspace.
Events
curl -X POST https://api.smartletter.ai/events -H "Authorization: Bearer $SMARTLETTER_API_KEY" -H "Content-Type: application/json" \
-d '{"email":"[email protected]","event":"purchase","properties":{"plan":"pro"}}'Rules
A rule is a condition or a group {"op":"and"|"or","rules":[…]}, 3 levels and 30 conditions at most. A condition reads a field ({"field","op","value"}) or an event ({"event","op":"performed"|"not_performed","min_count","within_days"}).
| Type | Operators |
|---|---|
| text | eq, neq, contains, not_contains, starts_with, ends_with, is_set, is_not_set |
| number | eq, neq, gt, gte, lt, lte, is_set, is_not_set |
| date | before, after (YYYY-MM-DD), within_last_days, older_than_days (days), is_set, is_not_set |
| boolean | is_true, is_false, is_set, is_not_set |
| choice | eq, neq, in, not_in, is_set, is_not_set |
Fields: email, first_name, last_name, name, language (text); status, source (choice); subscribed_at, last_emailed_at, last_opened_at, last_clicked_at (date); engagement_score (number); topic (subscribed / not_subscribed with a topic id); tags (has / has_not with one tag); custom.<key>. Where the contact came from: origin_via (choice: api, mcp, dashboard, hosted_form, archive, lead_magnet, store, integration), origin_url (text, the page the form was on), and origin_api_key, origin_form, origin_store, origin_lead_magnet (eq / neq with the id, is_set / is_not_set). System events: email.opened, email.clicked, email.bounced, contact.subscribed, contact.unsubscribed.
Save a filter with POST /audience-filters, count it with POST /audience-filters/count, and target an issue with audience_filter_id on POST /newsletters or PATCH /newsletters/{id}. The rules are copied when the issue is scheduled or sent; who matches is computed at each sending batch.