stubkit docs

Feature · Customer lifecycle

Win-back campaigns

Define a campaign once; stubkit's cron runs daily at 06:00 UTC and emails every user whose subscription transitioned to the trigger status (cancelled or expired) exactly N days earlier. Each recipient gets a fresh 7-day customer portal URL appended to the email as a CTA.

Fields per campaign

FieldMeaning
trigger_statuscancelled | expired
trigger_offset_days1–365. Send email this many days after the event.
email_subjectPlain text subject line.
email_bodyHTML body. Sanitized before sending (script/iframe/on-handlers stripped).
paywall_offering_slugOptional — reference for analytics attribution.

Dedupe

win_back_deliveries has a UNIQUE index on(campaign_id, user_external_id). A user is never emailed twice for the same campaign, regardless of how often the cron runs or whether ±12h window matching picks them up more than once.

REST endpoints

  • GET/POST /v1/admin/win-back-campaigns
  • PATCH/DELETE /v1/admin/win-back-campaigns/:id
  • GET /v1/admin/win-back-campaigns/:id/deliveries — deliveries + status totals.