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.
PocketStarter uses Brevo as the default email marketing provider. It offers a generous free plan with 300 daily emails and free API access. Since PocketStarter uses simple API calls to sync user data, you can easily update the webhook code to use another provider too.
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
- Sign up for a free Brevo account at brevo.com
- Go to your Brevo dashboard
- Navigate to SMTP & API → API Keys
- Generate a new API key
- 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
- Go to Brevo Dashboard → Contacts → Lists
- Create a new list (e.g., "PocketStarter Users") or use an existing one
- Copy the List ID (you'll see it in the URL or list details)
- 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:
- Sign in to their account
- Go to Profile (
/account
) - Toggle "Marketing Emails" on/off
- Save changes - This automatically updates their Brevo contact
Users can update their marketing preferences by toggling the "Receive marketing emails" switch in their account profile.