The campaign system in Talqui revolves around three primary entities: Campaign, Contact, and Campaign Dispatch. These entities work together to handle the creation, scheduling, and dispatching of messages in large-scale campaigns.
Campaign
The Campaign entity is the central object in the campaign system. It represents the actual marketing or communication effort that will be sent to multiple recipients. When a campaign is created, it includes the following:
- Contact IDs: A campaign holds a set of one or more Contact IDs, representing the recipients of the campaign. The relationship between the
CampaignandContactis one-to-many, meaning that a single campaign can target multiple contacts. - Schedule: The time at which the campaign will be sent (commonly the current time for immediate dispatch).
Contact
The Contact entity represents an individual recipient. It contains information about the customer, such as their phone number, email, or any other contact details required for the campaign. A single Contact can be associated with multiple campaigns over time.
- Relationship: A
Campaigncan target manyContacts, but eachCampaign Dispatchwill be specific to a singleContact.
Campaign Dispatch
Once a campaign is initiated, the system generates a Campaign Dispatch object for each Contact in the campaign. The Campaign Dispatch entity represents the actual sending attempt for each recipient and stores critical information about the delivery process, such as:
- Status: Indicates whether the dispatch was successful, failed, or is still pending.
- Timestamp (Schedule At): The exact time when the message was scheduled to be sent.
- Result: Tracks the outcome of the dispatch, including whether the message reached the recipient or if there was an error during transmission.
- Errors: If the message fails due to reasons like a rejection from the gateway (e.g., WhatsApp), the failure reason is logged in the
Campaign Dispatchobject.