👥
Customer Operations
CRM, email automation, support, customer lifecycle
4 FLOWS
▼
When a customer pays, fails to pay, or cancels — our systems react automatically
Stripe EventReal-time events: subscription.created, invoice.payment_failed, subscription.deleted, charge.dispute.created, etc.
→
CRM Webhook HandlerFastAPI endpoint at /api/webhooks/stripe. Validates HMAC-SHA256 signature, routes events to handlers.
→
Database UpdateCreates/updates Customer + Subscription records in PostgreSQL. Tracks cancellation reasons, metadata.
→
Automation EngineMatches the event type to automation rules. If a rule matches, it enqueues an email sequence with scheduled delays.
→
Email via ResendQueue processes every 2 minutes. Renders Jinja2 template with customer data. Sends via Resend API. Tracks delivery.
Automated email campaigns triggered by customer lifecycle events
Trigger EventExamples: subscription.created → welcome flow, payment_failed → dunning flow, subscription.deleted → win-back flow.
→
Automation RuleDefines a sequence of steps with delays. E.g., Step 1: immediately send welcome email, Step 2: send tips after 24 hours.
→
Email QueueItems scheduled for future delivery. Processed every 2 minutes by the CRM scheduler. Idempotent — won't re-send.
→
Resend APIHandles actual email delivery. Returns tracking data: opens, bounces, clicks.
→
AnalyticsOpen rates and clicks are tracked in the CRM but not yet surfaced in a dashboard. Planned improvement.
Customer support tickets handled via Discord bot running on Node 1
Customer opens ticketCustomer clicks the create-ticket button in the ModReady Discord server.
→
Bot triagesCategorizes ticket type: purchase, setup, technical, billing, other. Creates a private channel.
→
Staff notifiedSupport staff (cxtides, fonzie1984, picklecord) get notified in the ticket channel.
→
Resolution & closeStaff resolves the issue, ticket is closed. Transcript saved.
Stripe subscriptions and trial leads synced into CRM every morning
Stripe APIPaginated fetch of all subscriptions (100 per page). Filters out non-ModReady products.
→
CRM Stripe SyncRuns daily at 08:00 UTC via APScheduler. Creates/updates Customer + Subscription records. Detects status changes.
→
Trial DatabaseTrial leads from /var/www/modready-api/trials.db synced at 07:00 UTC into CRM.
→
PostgreSQLCRM database with full customer history, event timeline, subscription details.
Customer Journey iThe customer lifecycle from discovery to retention. Green = fully automated, amber = partially automated, gray = not yet built.
Discovery
Customer finds ModReady via Google Ads, Reddit, or word of mouth
Trial
Free trial signup on website — server auto-provisioned
Purchase
Stripe Checkout creates subscription, server activated
Onboarding
Welcome email sequence + setup tips via CRM automation
Active
Customer using their server, support available via Discord
At-Risk
Payment failed (dunning emails) or cancel_at_period_end set
Churned
Subscription ended, server suspended, data kept safe
Win-back
Re-engagement email campaigns to churned customers