Skip to main content

Campaign Management

Create and manage marketing campaigns targeting customer segments.

Campaign Types

TypeDescriptionUse Case
ONE_TIMESingle sendTournament announcement
RECURRINGScheduled repeatsWeekly newsletter
TRIGGEREDEvent-basedBooking confirmation
JOURNEYMulti-step sequenceOnboarding 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

ChannelDeliveryContent Source
EMAILMessaging ServiceTemplate ID
SMSMessaging ServiceTemplate ID
PUSHMessaging ServiceTemplate ID
WHATSAPPMessaging ServiceTemplate ID
SOCIALSocial PublisherInline content

Campaign Stats

MetricDescription
targetCountTotal in segment
sentCountSuccessfully sent
deliveredCountConfirmed delivered
openedCountEmail opens (unique)
clickedCountLink clicks (unique)
convertedCountConversions tracked
unsubscribedCountOpted out after

Computed Rates

RateFormula
deliveryRatedelivered / sent
openRateopened / delivered
clickRateclicked / opened
conversionRateconverted / clicked