Feature: Contact Segmentation (#310)
BE
9d ago+1273+1273+0123456789012345678901234567890123456789-58-58-01234567890123456789
Added availability to create segments on contacts lists and make campaigns over it
Closes #310
Summary by cubic
Adds contact segmentation so teams can target subsets of a contact book and see exact audience counts in campaigns.
-
New Features
- Manage segments per contact book: create, edit, delete with rules (equals, contains, is set, is not set) and live contact counts.
- Filter contact lists and exports by segment; invalid segment URLs auto-reset.
- Campaign editor: pick a segment (resets on contact book change) and see a live audience badge; campaign details show segment and recipient count;
getCampaignnow includescontactSegment. - Backend:
listSegments,createSegment,updateSegment,deleteSegment,getCampaignAudience; contacts APIs acceptsegmentId; campaign updates acceptcontactSegmentIdwith contact book validation; send/schedule/batching compute audience and totals using segment filters.
-
Migration
- Adds
ContactSegmenttable andCampaign.contactSegmentId. Run Prisma migrations to apply the new schema and indexes.
- Adds
Summary by CodeRabbit
- New Features
- Create, edit, and delete custom contact segments using contact-property rules.
- Filter contact lists and exports by segment.
- Target campaigns to selected segments or all contacts.
- View campaign audience counts and selected segment names.
- Segment targeting is preserved when campaigns are duplicated.