- Shipped
- October 14, 2026 at 1:18 PM UTC
- Author
- Kamo
- Commit
- 775ec66
LeadAvailableEmailSweep (every 15 s, singleton lease) finds leads that entered the pool 2-15 minutes ago and are still unclaimed, per org via ix_leads_org_created, and sends LEADS_AVAILABLE to everyone the accept-lead window would offer them to. A lead accepted within the two minutes has left the pool and nobody is written to. LeadAvailableEmailAudience applies the window's own rules per lead: Spend/Receive holder, active, a person (not SI, not a fake account), status AVAILABLE, accept gate clear, credit product (the window never opens for free-for-all), org credit not suspended, allotment active, credit or infinite balance, under Max Daily Spend, licensed in the property state. The letter names last name and state only. Redis keeps it to once per lead per member (written before the send: at most once) and one letter per member per two-minute quiet period; leads due while a member rests ride in their next letter, so a bulk import is one digest rather than a letter per tick. Needs shared-lib 9671cc7a and EmailService 0cdeb88 (template).
