Google Configuration
Prerequisites
For users to connect their Google Mail accounts to NocoBase, it must be deployed on a server that can access Google services, as the backend will call the Google API.
Register an Account
- Open https://console.cloud.google.com/welcome to go to Google Cloud.
- You will need to agree to the terms and conditions on your first visit.

Create an App
- Click "Select a project" at the top.

- Click the "NEW PROJECT" button in the pop-up.

- Fill in the project information.

- After the project is created, select it.


Enable the Gmail API
- Click the "APIs & Services" button.

- Go to the APIs & Services dashboard.

- Search for "mail".


- Click the "ENABLE" button to enable the Gmail API.


- Click the "OAuth consent screen" menu on the left.

- Select "External".

- Fill in the project information (this will be displayed on the authorization page) and click save.

- Fill in the Developer contact information and click continue.

- Click continue.

- Add test users for testing before the app is published.


- Click continue.

- Review the summary information and return to the dashboard.

Create Credentials
- Click the "Credentials" menu on the left.

- Click the "CREATE CREDENTIALS" button and select "OAuth client ID".

- Select "Web application".

- Fill in the application information.

- Enter the final deployment domain of the project (the example here is a NocoBase test address).

- Add the authorized redirect URI. It must be
domain + "/admin/settings/mail/oauth2". For example: https://pr-1-mail.test.nocobase.com/admin/settings/mail/oauth2

- Click create to view the OAuth information.

- Copy the Client ID and Client secret and paste them into the email configuration page.

- Click save to complete the configuration.
Publish the App
After completing the above process and testing features like test user authorization login and email sending, you can publish the app.
- Click the "OAuth consent screen" menu.

- Click the "EDIT APP" button, then click the "SAVE AND CONTINUE" button at the bottom.


- Click the "ADD OR REMOVE SCOPES" button to select the user permission scopes.

- Search for "Gmail API", then check "Gmail API" (confirm the Scope value is the Gmail API with "https://mail.google.com/").

- Click the "UPDATE" button at the bottom to save.

- Click the "SAVE AND CONTINUE" button at the bottom of each page, and finally click the "BACK TO DASHBOARD" button to return to the dashboard page.



- Click the "PUBLISH APP" button. A confirmation page will appear, listing the required information for publishing. Then click the "CONFIRM" button.

- Return to the console page, and you will see the publishing status is "In production".

- Click the "PREPARE FOR VERIFICATION" button, fill in the required information, and click the "SAVE AND CONTINUE" button (the data in the image is for demonstration purposes only).


- Continue to fill in the necessary information (the data in the image is for demonstration purposes only).

- Click the "SAVE AND CONTINUE" button.

- Click the "SUBMIT FOR VERIFICATION" button to submit for verification.

- Wait for the approval result.

- If the approval is still pending, users can click the unsafe link to authorize and log in.
