Skip to main content

Email campaigns

Quick guideโ€‹

Email campaigns have endpoints of their own, under /campaigns/email, and GET /campaigns does not list them. Only the contacts with the email marketing consent (email_status: OPTIN) receive them. SMS, RCS and WhatsApp have campaigns of their own, each in its section: SMS, RCS, WhatsApp.

  1. Pick the sender with GET /campaigns/email/senders: a VERIFIED address or domain of your account, verified in the Qlara platform, and for a domain one of its From Names.
  2. Create the campaign with POST /campaigns/email: it starts as a draft, CREATED. It needs a subject and exactly one of bodyHtml and templateId. destinationType 0 sends to the contacts of contactListIds, 1 to the addresses in destinations. Add a scheduledDate to send it later.
  3. Check the price with GET /campaigns/email/{id}/price: effectiveDestinations are the recipients charged, exclusions counts those left out (no valid address, no consent, a previous hard bounce), and hasEnoughCredit tells whether your wallet covers the price.
  4. Confirm it with PUT /campaigns/email/{id}/confirm: it answers 202, reserves the price and moves the campaign to VALIDATING while the platform checks it, then to PRE_BILLED, or to REJECTED or QUARANTINE when the checks fail. A wallet that does not cover the price answers 402. Every email carries an unsubscribe link: give your own link an id in the HTML (<a id="unsubscribe" href="#">) and pass that id as unsubscribeLinkId; otherwise a standard unsubscribe link is added at the end of the email. The {unsubscribe} marker of the single email send does not work in a campaign.
  5. Follow it with GET /campaigns/email/{id}: its status and the counters of sent, opened and clicked emails.

PUT /campaigns/email/{id} changes a campaign and moves it back to CREATED, to be confirmed again. DELETE /campaigns/email/{id} deletes it only before it is READY and, once confirmed, outside the platform's edit window, the minutes before the start in which a campaign can no longer change.

To send one email to one recipient, without a campaign, see Email.

Use cases: UC-010: Bulk Email Campaign