Table Summary
| Table |
Records |
Description |
crm_notes |
Per client |
Staff notes on client profiles |
crm_campaigns |
Per company |
Marketing automation campaigns |
crm_campaign_steps |
Per campaign |
Ordered steps within campaigns |
crm_templates |
Per company |
Reusable email templates (Markdown) |
crm_campaign_enrollments |
Per client/campaign |
Tracks client progress through campaigns |
crm_reminders |
Per client |
Scheduled follow-up tasks |
crm_campaign_packages |
Per campaign |
Links campaigns to service packages |
crm_email_queue |
Per email |
Queued, sending, sent, and failed emails |
crm_pipelines |
Per company |
Sales pipelines |
crm_pipeline_stages |
Per pipeline |
Ordered stages within pipelines |
crm_leads |
Per company |
Prospect/lead records |
crm_tags |
Per company |
Colour-coded labels |
crm_taggables |
Per tag/entity |
Polymorphic tag assignments |
crm_saved_filters |
Per company |
Reusable search queries |
crm_api_keys |
Per company |
API authentication tokens |
crm_rate_limits |
Per IP |
Rate limiting counters |
Key Relationships
crm_campaigns
├── crm_campaign_steps (ordered by sort_order)
├── crm_campaign_packages (links to Blesta packages)
└── crm_campaign_enrollments
├── crm_email_queue (emails generated by steps)
└── crm_reminders (reminders generated by steps)
crm_pipelines
├── crm_pipeline_stages (ordered by sort_order)
└── crm_leads (assigned to pipeline + stage)
crm_tags
└── crm_taggables (polymorphic: client or lead)
crm_api_keys → authenticates → api_leads/create endpoint
crm_rate_limits → rate-limits → api_leads/submit endpoint
Company Isolation
The following tables include a company_id column and are always filtered by the current company:
crm_campaigns
crm_templates
crm_pipelines
crm_leads
crm_tags
crm_saved_filters
crm_api_keys
Tables without company_id (like crm_notes, crm_reminders) are scoped through their parent relationships (client or campaign).
Lead Status Values
| Status |
Description |
new |
Freshly created, not yet contacted |
contacted |
Initial outreach made |
qualified |
Confirmed as a viable prospect |
proposal_sent |
Proposal or quote delivered |
won |
Converted to a client (automatically set when moved to a win stage) |
lost |
Did not convert (automatically set when moved to a loss stage) |
Email Queue Status Values
| Status |
Description |
queued |
Waiting to be sent |
sending |
Currently being sent (locked by cron) |
sent |
Successfully delivered |
failed |
All retry attempts exhausted |
Reminder Status Values
| Status |
Description |
pending |
Awaiting action |
completed |
Marked done by staff |
cancelled |
Cancelled before completion |
Enrollment Status Values
| Status |
Description |
active |
Currently progressing through campaign steps |
completed |
All steps processed |
cancelled |
Stopped before completion |