In this guide, we have explained the step by step directions to setup Google OAuth SMTP Configuration in Multivendor Marketplace App For shopify .
This feature allows you to set up your own SMTP to send emails directly from your mail server, giving you full control over the communication process with your customers.
With this setup, you can ensure that Marketplace related notifications, such as order updates and announcements, are sent seamlessly from your own email engine.
Enhancing your brand’s credibility and customer experience.

To configure Google OAuth SMTP for your Marketplace App, navigate to the Mail setting section. From there, select Mail Type as Google OAuth to set up your custom email server.
Here you have to enter the details of your own SMTP like Client ID and Client Secrete .

How to get Google OAuth SMTP details ?
To get the Google OAuth SMTP details simply visit Google console and create a new project .

Then go to API & Services and navigate to Library and search for Gmail API and enable it.

After that you have to click on create credential to get client id and client secret .

Next, under Credential Type, select Gmail API. For Data Access, choose User Data and click Next to proceed with the configuration.

In the next step, enter a name for your API under App Information and provide the required details. Once done, click Save and Continue to proceed.

On the OAuth Client ID page, select Application Type as Web Application. Enter redirect URL Provided Below or mentioned on the Marketplace app .

Authorized redirect URL: https://sp-seller.webkul.com/admin/index.php?p=admin_oauth_token
Authorised JavaScript origin: https://sp-seller.webkul.com
After entering the given URL, click Create to generate your Client ID.

How to add Scopes in google oauth ?
To properly authenticate and interact with Google services, you must enable the necessary API scopes. Follow these steps:
- Navigate to Google Auth Platform > Data access.
- Click on ADD OR REMOVE SCOPES.
- Select the required scope for your application. For example, if your application needs Gmail access, you must enable
https://mail.google.com/. - Save the changes and refresh the page.

These scopes define the permissions that your app needs from the user. Missing or incorrect scopes may lead to authentication issues.
How to Get Client ID and Client Secret ?
Here after creating this you will get your client id there click on Done.

After clicking Done, you’ll receive your Client ID and Client Secret needed to configure your Google OAuth SMTP. You can copy your Client ID and Client Secret from here .

Click on save button to continue .
After setting up your project, go to OAuth Consent Screen and configure your app’s audience.
Select Audience Type: You have two options:

Once you've selected External, your app will start in testing mode. To make it accessible to all users, you need to publish it:
Once published, your app will then require verification before it can finally be used in production.
Go to the Audience section in Google Auth Platform.
Locate the Publishing Status and click on Publish App.

After completing the previous steps, you need to create or add a test user to configure your Google OAuth SMTP.
Note : Test mode allows testing with limited users and a shorter refresh token lifetime( 7 Days ) , while production mode requires verification and is intended for public apps with wider user access.
To do this, click on OAuth Consent Screen, then select Add Test User. Add the test user from there(You have to enter the same mail here from which you are configuring this SMTP) .

Now, simply go to your SMTP configuration page, enter the Client ID, Client Secret, and the remaining details, then click “Save” to configure your SMTP.

NOTE: When configuring Google OAuth for your SMTP server,
it is important to note that any emails sent prior to the completion of the configuration will still be processed by your previous SMTP host server.
Once you finalize the Google OAuth SMTP configuration, the newly configured Google OAuth SMTP server will send all future emails.