While the primary MVP focuses on delivery and AI generation, the analytics pipeline provides the foundation for an event-driven Lead Scoring Engine to prioritize hot leads for the sales team.
To automatically quantify lead engagement based on sequence interactions, surfacing the most interested prospects for manual intervention.
Events processed from webhook_queue will synchronously increment or decrement a score integer on the Lead model.
Positive Engagement:
- Email Opened: +1 point (Max 3 points per campaign to prevent false positive pixel fires)
- Link Clicked: +5 points per unique link
- Reply Received: +15 points (Immediate state change to REPLIED overrides raw score importance)
Negative Engagement:
- Soft Bounce: -5 points (Retried by engine)
- Hard Bounce: -50 points (Lead marked invalid)
- Unsubscribe: -100 points (Added to global suppression list)
- Provider webhook (e.g., SendGrid) hits Django endpoint.
- Webhook payload is dumped to
webhook_queue. - Celery worker parses the payload, identifies the
MessageEvent. - Executes an atomic database transaction:
UPDATE leads SET score = score + :event_value WHERE id = :lead_id;
- If
scorecrosses a defined threshold (e.g., > 10), trigger a Firebase real-time notification to the assigned User's dashboard.