Connect Gmail
A Gmail connection is a mailbox that Marketing sends mail from, so that replies reach a person. It sends only; it does not read the mailbox. It is your org's or a brand's. See Connections for how connecting works in general.
Ways to connect
- Connect, through GreenMind's app, where it is open to your org.
- Use your own app: an OAuth client in your own Google Cloud project. Start at Google Cloud's credentials page; Google's guide to Gmail authorization for web server apps explains the rest.
There is no key option.
Making your own app
- Open the Use your own app dialog for Gmail on the Connections page, and keep it open.
- In the Google Cloud console, choose or create a project.
- Enable the API. In APIs & Services > Library, find Gmail API and enable it. Without it, Google refuses every send.
- Set up the consent screen. In Google Auth Platform, fill in Branding (app name, support email, logo, your home page, privacy policy and terms addresses, authorized domain) and choose an Audience. External is for any Google account. Internal is for accounts in your own Google Workspace only, and needs no Google verification (see below).
- Add the scopes. In Google Auth Platform > Data Access, choose Add or remove scopes, and under Manually add scopes enter the scopes below, one per line. Then Update and Save.
- Make the client. In Google Auth Platform > Clients, choose Create client, with type Web application. Under authorized redirect URIs, add the redirect URL from the dialog, copied exactly.
- Copy the client ID and client secret into the dialog and press Connect. Sign in to Google as the mailbox that should send, and allow it.
Scopes
openid
email
https://www.googleapis.com/auth/gmail.send
gmail.send is the smallest scope that lets an app send mail. openid and email name the mailbox the connection is for, so you can see which one it is.
Testing and verification
gmail.sendis one of the scopes Google calls sensitive. An External app that uses it needs Google's verification before it is open to everyone; Google's documentation explains the process.- While the consent screen is in Testing, only the Google accounts listed as test users (Google Auth Platform > Audience) can sign in, and a connection typically has to be connected again after about a week.
- If the mailbox is in a Google Workspace, an Internal app in a project of that Workspace needs no verification. An app is either internal or external, so this is a project of its own.
If it goes wrong
- Access blocked, or redirect URI mismatch. The redirect URI on the client differs from the dialog's, or your account is not a test user while the app is in Testing.
- The API is disabled. Enable the Gmail API in the project the client belongs to.
- Sends stop. Gmail limits how much a mailbox may send each day: about 2,000 messages for a Workspace account and about 500 for a consumer account.
- Needs reconnecting. Google no longer accepts the credentials, for example because the app's access was removed in the Google account's security settings. Reconnect.