Branded Unsubscribe Subdomain Guide

This guide explains how to serve your public unsubscribe page on a team-specific subdomain (for example https://your-brand.yourlastchance.app/unsub) instead of the shared Last Chance app URL with teamId in the query string.

Overview

Branded subdomains (phase 1) give each paid team a dedicated hostname for public unsubscribe traffic:

Before (shared URL)After (branded subdomain)
https://www.yourlastchance.app/unsub?email=…&teamId=…https://your-brand.yourlastchance.app/unsub

After a subscriber validates (or when using a session cookie from a prior visit), the browser address bar stays cleanemail and teamId are not required in the URL. Last Chance resolves the team from the hostname and stores identity in an encrypted session cookie.

What changes automatically

When a branded subdomain is active, Last Chance uses it in:

  • Page preview (editor and versions) — opens your branded host via the validation flow, then lands on a clean /unsub URL
  • Klaviyo unsubscribe hosted page HTML — redirect script targets your branded base URL (Settings → Email Providers → Klaviyo)
  • Public unsubscribe page — production links can omit teamId when the link is opened on your subdomain

The main SaaS dashboard at https://www.yourlastchance.app is unchanged. Only public paths (/unsub, unsubscribe APIs, and static assets) are served on branded hosts.


Requirements

  • Active paid subscription — Branded subdomains are not available on accounts without full access
  • Published unsubscribe page — Subscribers must have a live page to land on
  • Production DNS — Wildcard DNS for *.yourlastchance.app (or your configured public domain root) must point to Last Chance infrastructure. Your team does not create per-team DNS records in phase 1; you only choose a slug in the app

Choosing your subdomain

  1. Sign in to Last Chance at https://www.yourlastchance.app and open Account in the sidebar
  2. Open the Branded unsubscribe subdomain section
  3. Enter a slug (lowercase letters, numbers, hyphens; 3–63 characters)
  4. Click Save subdomain

You will see your live unsubscribe link (for example https://your-brand.yourlastchance.app/unsub) when the subdomain is saved.

Slug rules

  • At least 3 characters, at most 63
  • Lowercase letters, numbers, and hyphens only
  • Cannot start or end with a hyphen
  • Reserved names (for example www, api, unsub, dashboard) are blocked
  • Slugs already used by another team return “This subdomain is already taken”

Remove a subdomain

Click Remove in the same section. Public links revert to the shared app URL with teamId in query parameters (same behavior as before branded subdomains).


How subscribers reach your page

Keep using the Klaviyo unsubscribe hosted page setup. New HTML you copy from Last Chance uses your branded base URL in the script src.

If you already pasted hosted page HTML before adding a subdomain

Klaviyo stores the HTML you pasted—it does not update automatically when you save a subdomain in Last Chance.

  1. Open Settings → Email Providers → Klaviyo in Last Chance and click Copy Code (unsubscribe and preference-center pages if you use both).
  2. In Klaviyo Hosted Pages, edit each Last Chance hosted page and replace the HTML.
  3. You do not need to change which page is selected in Klaviyo consent settings—only the HTML content.

The redirect script sends subscribers to whatever origin is in the script src line. Old HTML pointing at www.yourlastchance.app keeps using the shared URL with teamId until you update it.

Flow (after hosted page HTML uses your branded script src):

Subscriber clicks Unsubscribe in email
  → Klaviyo consent / hosted page
  → Last Chance redirect script (branded origin)
  → /api/unsub/validate (sets session cookie)
  → https://your-brand.yourlastchance.app/unsub  (clean URL)

You can still open the page with email (and optionally teamId on the shared host) in the query string. On a valid branded host, teamId in the URL is optional because the hostname identifies your team.

For a quick test without an email campaign:

  1. Use Preview in the page editor with a test email (uses the validation endpoint, then a clean branded URL when a subdomain is active)
  2. Or visit your branded URL with email once; after validation, refresh /unsub without query params

Security: Klaviyo ID validation

When a branded subdomain is active, Last Chance shows a recommendation to enable Require Klaviyo ID validation on your unsubscribe page.

On a dedicated hostname, knowing someone’s email address is enough to open their unsubscribe experience unless Klaviyo ID validation is enabled. With validation on, links must include a valid Klaviyo profile ID (typical for links generated from Klaviyo emails and hosted-page redirects).

Enable it in the page editor under page settings if you use a branded subdomain in production.


Clean URLs and preview mode

Production visits

  1. Subscriber arrives with email (and optionally tracking params) either in the URL or via the validate redirect
  2. /api/unsub/validate confirms the address, sets an encrypted cookie, and redirects to /unsub without email or teamId
  3. /unsub reads the cookie (and hostname) to load the correct page

Preview from the dashboard

Preview opens /api/unsub/validate on your branded origin with returnUrl containing only preview parameters (preview=1, version, unsubscribePageId, etc.). After validation, the tab shows a clean URL such as:

https://your-brand.yourlastchance.app/unsub?preview=1&version=2&unsubscribePageId=…

Draft preview still requires a test email in the preview dialog; preview mode does not call Klaviyo for live profile updates.


Troubleshooting

IssueWhat to check
Save subdomain disabledConfirm you have an active paid subscription on the Account page
“Subdomain already taken”Pick a different slug; slugs are global across teams
Branded URL does not loadConfirm wildcard DNS for *.yourlastchance.app (or your platform public domain root) points to Last Chance
Page Not Found on branded hostTypo in slug, subdomain removed, or page not published; an unknown subdomain (for example https://typo.yourlastchance.app/unsub) shows the same 404 as a missing page
Still seeing teamId in linksSubdomain not saved, or link built against the shared app URL — re-copy Klaviyo hosted page HTML after activating the subdomain
Preview opens wrong hostRefresh the Account subdomain section; preview uses your active subdomain from the server

For infrastructure and engineering details (routing, validation, DNS), see docs/branded-public-domain-runbook.md in the Last Chance repository (operator-focused; not part of this in-app guide). For phase 1 vs phase 2 scope, see docs/branded-public-domain-plan.md.