Campaign Management
Create and manage marketing campaigns targeting customer segments.
Campaign Types
| Type | Description | Use Case |
|---|---|---|
| ONE_TIME | Single send | Tournament announcement |
| RECURRING | Scheduled repeats | Weekly newsletter |
| TRIGGERED | Event-based | Booking confirmation |
| JOURNEY | Multi-step sequence | Onboarding series |
Campaign Workflow
┌─────────────────────────────────────────────────────────────────┐
│ CAMPAIGN LIFECYCLE │
├─────────────────────────────────────────────────────────────────┤
│ │
│ DRAFT ──▶ SCHEDULED ──▶ ACTIVE ──▶ COMPLETED │
│ │ │ │ │
│ │ │ ▼ │
│ │ │ PAUSED ─────────┐ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ Edit Edit/Cancel Resume/Cancel │
│ │
└─────────────────────────────────────────────────────────────────┘
Creating a Campaign
// 1. Create campaign
const campaign = await createCampaign({
name: "Summer Tournament 2024",
type: "ONE_TIME",
segmentId: "active-golfers-segment-id",
channels: ["EMAIL", "SMS", "FACEBOOK"],
scheduledAt: "2024-06-01T09:00:00Z",
timezone: "Africa/Johannesburg"
});
// 2. Configure channel content
await setCampaignContent(campaign.id, {
email: { templateId: "tournament-invite-email" },
sms: { templateId: "tournament-invite-sms" },
social: {
content: "Join us for the Summer Tournament 2024!",
mediaUrls: ["https://..."],
platforms: ["FACEBOOK", "INSTAGRAM"]
}
});
// 3. Schedule sends
await scheduleCampaign(campaign.id);
Available Channels
| Channel | Delivery | Content Source |
|---|---|---|
| Messaging Service | Template ID | |
| SMS | Messaging Service | Template ID |
| PUSH | Messaging Service | Template ID |
| Messaging Service | Template ID | |
| SOCIAL | Social Publisher | Inline content |
Campaign Stats
| Metric | Description |
|---|---|
targetCount | Total in segment |
sentCount | Successfully sent |
deliveredCount | Confirmed delivered |
openedCount | Email opens (unique) |
clickedCount | Link clicks (unique) |
convertedCount | Conversions tracked |
unsubscribedCount | Opted out after |
Computed Rates
| Rate | Formula |
|---|---|
deliveryRate | delivered / sent |
openRate | opened / delivered |
clickRate | clicked / opened |
conversionRate | converted / clicked |