Connect Gmail
Part 1: Admin setup (one-time)
Section titled “Part 1: Admin setup (one-time)”Before anyone on your team can connect their Gmail, you need to create OAuth credentials in Google Cloud Console.
Step 1: Create a Google Cloud project
Section titled “Step 1: Create a Google Cloud project”- Go to Google Cloud Console
- Click the project dropdown at the top and click New Project
- Name it (e.g., “Bobby CRM”) and click Create
- Select the new project from the dropdown
Step 2: Enable the Gmail API
Section titled “Step 2: Enable the Gmail API”- Go to APIs & Services > Library
- Search for “Gmail API”
- Click Gmail API and then Enable
Step 3: Configure OAuth consent screen
Section titled “Step 3: Configure OAuth consent screen”- Go to APIs & Services > OAuth consent screen
- Select External user type and click Create
- Fill in the app information:
- App name: Bobby CRM (or your company name)
- User support email: your admin email
- Developer contact: your admin email
- Click Save and Continue
- On the Scopes page, click Add or Remove Scopes and add:
https://www.googleapis.com/auth/gmail.readonlyhttps://www.googleapis.com/auth/gmail.sendhttps://www.googleapis.com/auth/gmail.modifyhttps://www.googleapis.com/auth/userinfo.email
- Click Save and Continue
- Add test users if your app is in testing mode (add the email addresses of team members who will connect)
- Click Save and Continue
Step 4: Create OAuth credentials
Section titled “Step 4: Create OAuth credentials”- Go to APIs & Services > Credentials
- Click Create Credentials > OAuth 2.0 Client ID
- Application type: Web application
- Name: “Bobby CRM”
- Under Authorized redirect URIs, add:
For local development, also add:https://<your-crm-api-domain>/api/v1/email/accounts/gmail/callbackhttp://localhost:8000/api/v1/email/accounts/gmail/callback
- Click Create
- Copy the Client ID and Client Secret
Step 5: Configure Bobby CRM
Section titled “Step 5: Configure Bobby CRM”Add these to your CRM’s environment configuration:
GMAIL_CLIENT_ID=<your_client_id>GMAIL_CLIENT_SECRET=<your_client_secret>EMAIL_ENCRYPTION_KEY=<generated_key>To generate the encryption key, run:
python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"Restart the CRM backend after updating the environment.
Part 2: Connect your account
Section titled “Part 2: Connect your account”- Go to Settings > Email Settings
- Click Connect Gmail
- A Google sign-in window opens — log in to your Gmail account
- Review the permissions and click Allow
- You’ll be redirected back to Bobby CRM
- Your Gmail account now appears under Connected Accounts
Sync your emails
Section titled “Sync your emails”- Click Sync Now on your connected account to pull in emails immediately
- Bobby CRM fetches up to 100 messages per sync
- Emails are automatically linked to matching contacts and companies in your CRM
Troubleshooting
Section titled “Troubleshooting”| Problem | Solution |
|---|---|
| ”Access blocked: This app’s request is invalid” | Check that the redirect URI in Google Cloud Console matches exactly |
| ”Error 403: access_denied” | Make sure the OAuth consent screen is configured and your email is added as a test user |
| No emails appearing after sync | Verify that you have contacts in the CRM with matching email addresses |
| ”OAuth credentials not configured” | Ask your admin to complete Part 1 |