Store events
Site and app send add_to_cart, checkout_started and order_placed. Orders are also confirmed server-side.
Identity and consent
Anonymous visits merge into one profile at login. Opt-ins are stored with time, source and wording.
Cart state store
Postgres holds carts, orders, consent and a log of every message, keyed so nothing sends twice.
Idle-cart sweep
Every five minutes, finds carts quiet for 45 minutes with no order and no reminder.
Pre-send checks
Consent, orders on any device, stock, price, quiet hours and per-shopper limits.
Decision model
Scores intent, then picks the template, the timing and whether an offer is worth it.
WhatsApp delivery
Cloud API sends the template with a signed link that rebuilds the cart on any device.
Replies and reporting
An assistant answers from live stock and policy, hands off to staff, and feeds the dashboard.