PocketStarter Docs

Marketing

Want to build an email list and manage user marketing preferences? PocketStarter automatically syncs your users to Brevo for easy email marketing, but it's easy to integrate with other marketing providers as well.

How it works

PocketStarter automatically syncs user data to Brevo when:

  • New users sign up → They're added to your Brevo contact list
  • Users change marketing preferences → They're added/removed from your list

Quick setup

1. Get your Brevo API key

  1. Sign up for a free Brevo account at brevo.com
  2. Go to your Brevo dashboard
  3. Navigate to SMTP & APIAPI Keys
  4. Generate a new API key
  5. Copy the API key

2. Add your API key to Environment Variables

Add your Brevo API key to your PocketBase .env.local file:

# .env.local
BREVO_API_KEY=your_brevo_api_key_here

3. Get your contact list ID

  1. Go to Brevo DashboardContactsLists
  2. Create a new list (e.g., "PocketStarter Users") or use an existing one
  3. Copy the List ID (you'll see it in the URL or list details)
  4. Update your PocketBase hook with the list ID in pocketbase/pb_hooks/brevo.pb.js:
listIds: [YOUR_LIST_ID_HERE], // Replace with your actual list ID

User marketing preferences

How Users Control Marketing

Users can manage their marketing preferences in their profile settings:

  1. Sign in to their account
  2. Go to Profile (/account)
  3. Toggle "Marketing Emails" on/off
  4. Save changes - This automatically updates their Brevo contact

Marketing emails toggle in user profile

Users can update their marketing preferences by toggling the "Receive marketing emails" switch in their account profile.