Campaigns

Entities

Updated on October 4, 2024

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 Campaign and Contact is 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 Campaign can target many Contacts, but each Campaign Dispatch will be specific to a single Contact.
Important to understant that to include some contact into a campaign that contact should be previously associated to contact channel specified in campaign or in other case, contact can be attached manually to a specific campaign.

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 Dispatch object.