Coach Portal Access Tokens
Generate signed access tokens for the Brevo email campaign. Each coach receives a unique, time-limited link that opens their portal directly.
Campaign Settings
72 hours = 3 days (recommended)
Batch Export — All Active Coaches
Generates a unique access token for every active coach with an email address. Downloads a CSV with columns: EXTERNAL_COACH_ID, FIRST_NAME, LAST_NAME, EMAIL, SCHOOL, DIVISION, TITLE, ACCESS_URL.
Brevo merge field: Use {{ contact.ACCESS_URL }} in your email template as the portal access button link. Import the CSV into Brevo as a contact list with ACCESS_URL as a custom attribute.
Test Single Coach Token
Generate a token for one coach by their External Coach ID (e.g. RCPTEST001, DI119650). Use this to test the access flow before sending the campaign.
How It Works
- Generate tokens → download CSV
- Import CSV into Brevo as a contact list with ACCESS_URL as a custom attribute
- In your Brevo email template, use
{{ contact.ACCESS_URL }}as the portal button link - Coach clicks the button → lands on
/coach/access?t=TOKEN - Server validates the token, finds/creates their account, sets session cookie
- Coach is redirected directly to
/dashboard/coach— no login required
Tokens are HMAC-SHA256 signed with BETTER_AUTH_SECRET, unique per coach, and expire after the configured hours. A coach cannot access another coach's account. Email is never trusted from the URL — only from the signed token payload matched to the database.