Skip to content

Course Brochure Flow

Overview

The Course Brochure flow lets a visitor register their interest in a course and receive the course brochure PDF in a single action. When a course has a brochure uploaded, the "Register Interest" button on the course detail page changes its label to "Register Interest & Download Brochure". Filling the form once does both jobs — no separate button or second form.

User Journey

  1. Visit course page. The visitor sees a single CTA button in the sidebar. Its label depends on whether a brochure is configured:
  2. With brochure: "Register Interest & Download Brochure"
  3. Without brochure: "Register Interest" (unchanged behaviour)
  4. Fill the form. The visitor provides their name, email, phone, and company. The form is protected by Cloudflare Turnstile.
  5. Submit. On success the visitor sees a confirmation: "Thank you! We've received your details and sent the course brochure to your email."
  6. Receive email. The backend generates a unique, time-limited token and emails a secure download link to the provided address.
  7. Download. Clicking the link verifies the token, checks expiry, and streams the PDF brochure from Supabase Storage (course-brochures bucket) to the browser.

How Brochures Are Set Up

Admins upload the brochure PDF in the Course Editor (perfxcel-admin), in the "Course Brochure" file input. On save, the file is uploaded via the API to the course-brochures bucket and the resulting URL is persisted in courses.brochure_url. Once brochure_url is set, the unified button appears automatically on the public site.

Token Expiry

Brochure tokens expire after the number of days configured in the brochure_expiry_days setting (default 180 days). Admins can regenerate and resend an expired link from the Interests list. See Configurable Link Expiry.

Security

  • The form is protected by Cloudflare Turnstile (bot protection).
  • Tokens are cryptographically random UUIDs generated server-side.
  • Files are served via the API backend, not through public Supabase URLs, so the token is always validated before delivery.
  • Expired tokens return HTTP 403 with a descriptive error message.

Interest Record

Every brochure request creates an entry in the course_interests table with brochure_token and brochure_expires_at populated. The interest record appears in the Interests list in the admin with a brochure indicator badge (📄). Admins can manage it — update status, resend the brochure, or erase the PII — from the same interface as regular interests.