MojarMojar
Connectors

Gmail

Send email from your agent's workflows using a Gmail OAuth account.

The Gmail connector lets your agent send email — including HTML-formatted messages with CC and BCC — from a Gmail address you authorise via OAuth.

What you can do

ActionNode typeDescription
Send emailSend EmailCompose and send an email to one or more recipients. Supports plain text and HTML body, CC, and BCC.

Node fields support {{variable}} template syntax, so the recipient address, subject, and body can all be dynamically filled from earlier workflow steps.

Before you start

Gmail uses OAuth 2.0. You need three things from a Google Cloud project:

Credential fieldDescription
OAuth Client IDThe client ID from your Google Cloud OAuth credentials (your-client-id.apps.googleusercontent.com).
OAuth Client SecretThe client secret paired with the above (GOCSPX-...).
Refresh TokenA long-lived token obtained by completing the OAuth consent flow for the Gmail send scope (1//0...).

Optionally, you can set a From Email address. If left blank, the address of the authenticated Google account is used.

Your Mojar workspace admin may have already configured the Google OAuth client at the platform level. In that case you only need to supply a refresh token.

Connect Gmail

Create a Google Cloud project and enable the Gmail API.

Go to the Google Cloud Console. Create a project (or select an existing one) and enable the Gmail API under APIs & Services.

Configure the OAuth consent screen.

Under APIs & Services > OAuth consent screen, fill in the required fields. Choose External for testing or Internal if your organisation uses Google Workspace.

Create OAuth credentials.

Go to APIs & Services > Credentials > Create Credentials > OAuth client ID. Select Web application and add your redirect URI. Copy the Client ID and Client Secret.

Open Credentials →

Obtain a refresh token.

Use the OAuth 2.0 Playground to authorise the https://www.googleapis.com/auth/gmail.send scope with your credentials. Exchange the authorisation code for tokens and copy the Refresh Token.

Enter the credentials in Mojar.

In your agent, open Integrations, find Gmail, and click its card. Paste the OAuth Client ID, OAuth Client Secret, and Refresh Token into the fields, give the connection a name, and click Connect.

Gmail connect dialog showing the OAuth Client ID, OAuth Client Secret, Refresh Token, and From Email fields

Use it in a workflow

Open a workflow in the workflow editor and click + to add a node.
Select Send Email from the node picker. The Gmail connector is required for this node type.
In the node configuration panel, choose your linked Gmail credential from the credential picker.

Fill in the fields:

  • To — recipient address, e.g. {{customer.email}}
  • Subject — email subject line
  • Body — email body; set Body type to html to use HTML markup
  • CC / BCC — optional additional recipients
Save the workflow. When the workflow runs, the node sends the email from the authorised Gmail account.

On this page