Connect Outlook
Part 1: Admin setup (one-time)
Section titled “Part 1: Admin setup (one-time)”Before anyone on your team can connect their Outlook account, you need to register an application in the Azure Portal.
Step 1: Register a new application
Section titled “Step 1: Register a new application”- Go to Azure Portal > Azure Active Directory > App registrations
- Click New registration
- Fill in:
- Name: Bobby CRM
- Supported account types: Accounts in any organizational directory and personal Microsoft accounts
- Redirect URI: Select “Web” and enter:
https://<your-crm-api-domain>/api/v1/email/accounts/outlook/callback
- Click Register
- Copy the Application (client) ID from the overview page
Step 2: Create a client secret
Section titled “Step 2: Create a client secret”- Go to Certificates & secrets > Client secrets
- Click New client secret
- Add a description (e.g., “Bobby CRM”) and set an expiry
- Click Add
- Copy the Value immediately (it won’t be shown again)
Step 3: Set API permissions
Section titled “Step 3: Set API permissions”- Go to API permissions > Add a permission > Microsoft Graph
- Select Delegated permissions and add:
Mail.ReadMail.SendMail.ReadWriteUser.Readoffline_access
- Click Add permissions
- Click Grant admin consent (requires Azure AD admin)
Step 4: Configure Bobby CRM
Section titled “Step 4: Configure Bobby CRM”Add these to your CRM’s environment configuration:
OUTLOOK_CLIENT_ID=<your_client_id>OUTLOOK_CLIENT_SECRET=<your_client_secret>EMAIL_ENCRYPTION_KEY=<generated_key>If you haven’t already created an encryption key (e.g., from Gmail setup), generate one:
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 Outlook
- A Microsoft sign-in window opens — log in to your Outlook/Microsoft 365 account
- Review the permissions and click Accept
- You’ll be redirected back to Bobby CRM
- Your Outlook account now appears under Connected Accounts
Sync your emails
Section titled “Sync your emails”- Click Sync Now on your connected account
- Bobby CRM fetches up to 100 messages per sync
- Emails are automatically linked to matching contacts and companies
Troubleshooting
Section titled “Troubleshooting”| Problem | Solution |
|---|---|
| ”AADSTS65001: The user or administrator has not consented” | Ask your Azure AD admin to grant admin consent for the app permissions |
| Redirect URI mismatch error | Verify the redirect URI in Azure matches exactly — including trailing slashes |
| No emails appearing after sync | Check that contacts exist in the CRM with matching email addresses |
| ”OAuth credentials not configured” | Ask your admin to complete Part 1 |