PushizoDocs
Messaging & campaigns

Dynamic Content (content tables and `{% lookup %}`)

Content tables enable personalization by selecting rows uploaded via CSV based on a key column: for example, campaign copy per city, store or product. Decision record:…

Content tables enable personalization by selecting rows uploaded via CSV based on a key column: for example, campaign copy per city, store or product. Decision record: docs/adr/0028-data-feeds-dynamic-content-ai.md.

Preparing the CSV

  • UTF-8 (a BOM is allowed), the first row is the header, comma-separated; quoted fields are supported.
  • Column names start with a letter or underscore and contain only letters/digits/underscores (kampanya_metni).
  • Key column values cannot be empty and must be unique.
  • Limits: 100,000 rows, 50 columns, 2000 characters per cell, 20 MB per file.
sehir,kampanya_metni,indirim
İzmir,"Kordon'da %20 indirim",20
Ankara,Kızılay şubesi açıldı,10

Uploading

Dashboard → Messages → Dynamic Content → Content tables → Upload CSV, or the public API (multipart; fields before the file):

curl -X POST https://api.pushizo.example/v1/apps/$APP_ID/content-tables \
  -H "Authorization: Bearer $API_KEY" \
  -F name=sehirler -F key_column=sehir -F file=@sehirler.csv

Re-uploading (PUT …/content-tables/{tableId}/rows) replaces all rows in the table and increments its version; since the row cache used at send time is tied to the version, the new rows take effect immediately. Preview: GET …/content-tables/{tableId}/rows?q=<key prefix>&limit=50&offset=0.

Using it in templates

{% lookup 'sehirler' key: user.tags.sehir as satir %}
{% if satir %}{{ satir.kampanya_metni }}{% else %}Deals in every city!{% endif %}
  • The key expression can use user.*, subscription.*, custom_data.* and feed.* values.
  • Keys are compared as text (numbers are converted to text, leading/trailing whitespace is ignored).
  • If there is no match, satir is empty; always provide a fallback with {% if %}.
  • Limitation: keys that depend on a local variable inside a {% for %} loop return empty, because they cannot be batch-loaded before sending.

The keys used in a send are computed for every recipient in the delivery batch and loaded with a single query per table.

Promo codes ({% promo_code %})

Upload single-use codes as a list; the tag in the template gives each recipient a different code. Decision record: docs/adr/0059-promosyon-kodu-havuzu.md.

Dashboard → Messages → Dynamic Content → Promo codes, or the public API:

curl -X POST https://api.pushizo.example/v1/apps/$APP_ID/promo-code-lists \
  -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json" \
  -d '{"name":"yaz_indirimi","expires_at":"2027-09-01T00:00:00Z"}'

curl -X POST https://api.pushizo.example/v1/apps/$APP_ID/promo-code-lists/$LIST_ID/codes \
  -H "Authorization: Bearer $API_KEY" -F file=@kodlar.csv

Codes go in the first column of the file; the header is optional (code, kod, coupon). A code can be at most 128 characters and cannot contain whitespace or < > & " ' \ { } %. At most 1,000,000 codes per list, 20 MB per file. Codes already in the list are skipped.

Your discount code: {% promo_code 'yaz_indirimi' %}
  • All references to the same list within one delivery return the same code; the code does not change on retry.
  • If no codes are left, or the list was deleted or has expired, no message with an empty code is sent: the delivery is dropped with a PromoCodeUnavailable error.
  • An allocated code does not return to the pool; it counts as used even if the provider returns a permanent error.
  • A code is allocated even if the tag is inside an {% if %}.
  • Template previews don't consume codes and show PROMO-ONIZLEME. Test sends consume real codes.
  • Works for push, email, SMS, WhatsApp and RCS sends. In in-app messages and journey webhooks the tag returns empty.
  • Viewing unused codes requires the templates.write permission.

On this page