Gmail Integration Setup

Complete guide to connecting Gmail/Google Workspace to your app

Why Use Gmail?

Free Tier

Send up to 2,000 emails/day for free

High Deliverability

Gmail's reputation ensures inbox delivery

Easy Setup

Use existing Gmail/Workspace account

Step 1
Create Google Cloud Project
  1. 1

    Go to Google Cloud Console

    https://console.cloud.google.com
  2. 2

    Create a New Project

    Click "Select a project" → "New Project"

    Name it: Neuron Healthcare Email

  3. 3

    Select Your New Project

    Make sure it's active in the top dropdown

Step 2
Enable Gmail API
  1. 1

    Navigate to APIs & Services

    In left sidebar: "APIs & Services" → "Library"

  2. 2

    Search for Gmail API

    Type "Gmail API" in search box

  3. 3

    Enable the API

    Click "Enable" button

Step 3
Create OAuth 2.0 Credentials
  1. 1

    Go to Credentials

    "APIs & Services" → "Credentials"

  2. 2

    Configure OAuth Consent Screen

    Click "Configure Consent Screen"

    • • Choose "External" (or "Internal" for Workspace)
    • • App name: Neuron Healthcare
    • • User support email: Your email
    • • Developer contact: Your email
    • • Click "Save and Continue"
  3. 3

    Add Scopes

    Click "Add or Remove Scopes"

    https://www.googleapis.com/auth/gmail.send

  4. 4

    Create OAuth Client ID

    Click "Create Credentials" → "OAuth client ID"

    • • Application type: Web application
    • • Name: Neuron Healthcare Email Client
    • • Authorized redirect URIs: https://developers.google.com/oauthplayground
  5. 5

    Save Your Credentials

Step 4
Generate Refresh Token
  1. 1
  2. 2

    Configure OAuth Playground

    Click the ⚙️ gear icon (top right)

    • • Check "Use your own OAuth credentials"
    • • Paste your Client ID
    • • Paste your Client Secret
    • • Click "Close"
  3. 3

    Select Gmail API Scope

    In left panel, find "Gmail API v1"

    https://www.googleapis.com/auth/gmail.send

    Click the checkbox, then "Authorize APIs"

  4. 4

    Sign In & Authorize

    Sign in with the Gmail account you want to send emails from

    Grant all requested permissions

  5. 5

    Exchange Authorization Code

    Click "Exchange authorization code for tokens"

  6. 6

    Copy Refresh Token

Step 5
Configure in Your App
  1. 1

    Go to Admin Integrations

    Dashboard → Admin Integrations → Email tab

  2. 2

    Enable Email & Select Gmail

    Toggle "Enable Email Service" ON

    Select "Gmail / Google Workspace" as provider

  3. 3

    Paste Your Credentials

    • Gmail Client ID: Your OAuth Client ID
    • Gmail Client Secret: Your OAuth Client Secret
    • Gmail Refresh Token: The refresh token from OAuth Playground
    • From Email: The Gmail address you authorized
  4. 4

    Save & Test

    Click "Save Gmail Configuration"

    Click "Send Test Email" to verify it works

Troubleshooting

Error: "Access blocked: Authorization Error"

→ Make sure you completed the OAuth Consent Screen configuration

→ Add your email to "Test users" in OAuth consent screen

Error: "Invalid grant"

→ Your refresh token expired or is invalid

→ Go back to OAuth Playground and generate a new one

Error: "Redirect URI mismatch"

→ Make sure you added the OAuth Playground URL to authorized redirect URIs

Emails not sending

→ Check Gmail's "Sent" folder for the sending account

→ Verify the scope includes gmail.send

→ Check browser console for error messages