This guide walks you through creating a Google Cloud OAuth client so Mail Pro can send and receive through the Gmail API.
You only need this if your mail is hosted at Google Workspace. For Microsoft 365 see Microsoft 365 Setup; for any other host see IMAP/SMTP Setup.
Step 1: Create a Google Cloud project
- Go to Google Cloud Console → New Project
- Give it a name such as
Odoo Mail Proand create it - Make sure the new project is selected in the project picker at the top
Step 2: Enable the Gmail API
- Go to APIs & Services → Library
- Search for Gmail API
- Click Enable
Nothing works until this is done: the OAuth screen will succeed and every call afterwards will fail.
Step 3: Configure the consent screen
- Go to APIs & Services → OAuth consent screen
-
Choose Internal
Internal means only accounts in your own Workspace can grant consent, which is exactly what this module needs. It also means Google does not put your app through the CASA security assessment that the scopes below would otherwise require. Choose External only if you know why you need it.
- Fill in the app name, support email and developer contact
- Save
Step 4: Add the scopes
On the Scopes step, add these four:
| Scope | Why |
|---|---|
openid |
Identifies the user during the callback |
email |
Reads the address that just signed in |
https://www.googleapis.com/auth/gmail.modify |
Read incoming mail and label it |
https://www.googleapis.com/auth/gmail.send |
Send mail |
gmail.modify and gmail.send are restricted scopes. Mail Pro does not ask for
https://mail.google.com/ (full mailbox control), because it never needs to
delete anything.
Step 5: Create the OAuth client
- Go to APIs & Services → Credentials
- Click Create Credentials → OAuth client ID
- Application type: Web application
- Under Authorized redirect URIs, paste the callback URL that Odoo shows in
Settings → Mail Pro once you have picked Google Workspace as the provider.
The format is
https://your-odoo-domain.com/google_oauth/callback - Click Create and copy the Client ID and Client secret
The redirect URI has to match character for character, including https and any
trailing path. A mismatch shows up as redirect_uri_mismatch on the consent
screen.
Step 6: Configure in Odoo
- Go to Settings → Mail Pro and press the arrow on step 1, Email Provider
- Create the provider row and set Provider to Google Workspace
- Enter the Client ID and Client Secret
- Save
A database runs on one provider. Switching later means editing this row, and Google issues a new client secret for it.
Shared addresses on Gmail
A Gmail shared mailbox works differently from a Microsoft 365 one. On Microsoft
365 a colleague sends as sales@ using their own token and SendAs rights. On
Google, sales@ is a real Workspace account with its own credentials and no
owner.
So to set one up: sign in as that address when connecting it, and leave Odoo User empty on the resulting account. Mail Pro then uses the address's own credentials rather than borrowing anyone's.
Next Steps
Proceed to User Setup to connect accounts.