Skip to content
All articles
Integrations

Connect Gmail / Outlook (OAuth) and sync emails

Connect your Google Workspace (Gmail) or Microsoft 365 (Outlook) account via OAuth, using your own organization's OAuth app, and automatically log emails as activities on your contacts.

💡 Old emails showing up cut off? After connecting, click "Fetch full history" on the card: the CRM re-fetches the full text of older messages that kept only the preview. Safe to repeat (it never shortens what is already complete). Email attachments are also downloaded and stored.

You can connect your Google Workspace (Gmail) or Microsoft 365 (Outlook) mailbox to the CRM. Once connected, the CRM reads your recent emails and, for each message whose sender or recipient matches a Contact or Lead (by email), logs an "email" activity on that record's timeline.

The model is BYO ("bring your own"): you use your own organization's OAuth app. We never see your credentials and there is no cost on our side. The integration starts inert: nothing happens until you set up the OAuth app and connect the account.

Prerequisites

  • A Google Workspace (Gmail) OR Microsoft 365 (Outlook) account. Your regular work account is fine.
  • Permission to create an OAuth app in your organization: access to the Google Cloud Console (Gmail) or the Azure Portal / Microsoft Entra ID (Outlook). In companies, this usually requires an IT administrator.
  • In Sellio, administrator access (permission to manage settings) to save the app credentials in Settings → Integrations. Connecting the mailbox itself (Step 3) is done by each user for their own account.

Step 1: Create your organization's OAuth app

Google Workspace (Gmail): in the Google Cloud Console, create a project, configure the OAuth consent screen, enable the Gmail API and create an "OAuth client ID" credential (Web application). Copy the Client ID and the Client Secret.

Microsoft 365 (Outlook): in the Azure Portal, go to Microsoft Entra ID → App registrations → New registration. Under "Certificates & secrets", generate a Client Secret. Under "API permissions", add Microsoft Graph with the delegated permissions Mail.Read and User.Read. Copy the Client ID (Application ID) and the Client Secret.

💡 For both providers, register EXACTLY the redirect URI shown on the integration card (it ends in /api/oauth/google/callback or /api/oauth/microsoft/callback). It must be identical, otherwise the provider will refuse the connection.

Step 2: Paste the credentials into the CRM

  1. Open Settings → Integrations and find the "Google Workspace (Gmail)" or "Microsoft 365 (Outlook)" card.
  2. Copy the redirect URI shown and register it in your OAuth app (Step 1).
  3. Paste the Client ID and the Client Secret and click "Save app credentials". The Client Secret is stored encrypted and is never displayed back.

Step 3: Connect your account

  1. Still on the card, click "Connect". You will be taken to the provider's consent screen, already signed in to your account.
  2. Authorize read access to email. You return to the CRM and the card now shows "Connected as" with the account address.
  3. Click "Sync emails" to pull in recent emails now. The CRM tells you how many emails it read and how many activities it created.

Each user connects their own mailbox: the sync runs in the context of whoever connected it. Emails become activities only when the sender or recipient matches an existing Contact or Lead (by the email field). Emails that match no record are ignored.

Security and privacy

Access and refresh tokens are stored encrypted and are never displayed. The access token is renewed automatically when it expires, without a new login. The email connection is completely separate from your CRM login: connecting or disconnecting here does not change how you sign in to the system.

💡 To revoke access, click "Disconnect" on the card, and the stored tokens are removed. You can reconnect at any time. If the connection expires (for example, after changing the account password), use "Reconnect".
Example: Redirect URI to register: https://app.yourcompany.com/api/oauth/google/callback (Google) or https://app.yourcompany.com/api/oauth/microsoft/callback (Microsoft).

How to test

  1. After connecting (Step 3), confirm the card shows "Connected as" with the right address.
  2. Click "Sync emails". The CRM tells you how many emails it read and how many activities it created.
  3. Open a Contact or Lead you know has recently exchanged emails and check the timeline: an activity of type "Email" should appear.

Troubleshooting

  • Error "redirect_uri_mismatch" or the provider refuses the connection: the redirect URI registered in the OAuth app differs from the one shown on the card. Copy it again and paste it EXACTLY the same (same domain, same trailing slash).
  • 401/invalid_client when connecting: wrong Client ID or Client Secret. Re-enter the credentials on the card (the Secret never comes back from the server, so re-paste it in full).
  • Connects, but does not create activities: emails only become activities when the sender/recipient matches a Contact or Lead by the email field. Emails with no match are ignored, so add the email to the record.
  • "Access denied" / consent screen blocked: on Google, publish the OAuth consent screen (or add the user as a tester); on Azure, grant admin consent to the permissions.
  • The connection stopped working (e.g., after changing the account password): click "Reconnect" on the card to redo consent and renew the tokens.

Open this article inside the system

Read it and want to see it working?

The account is free and the whole manual is available inside the system, with an assistant that answers from this very content.

Create free account
Connect Gmail / Outlook (OAuth) and sync emails · Sellio