> ## Documentation Index
> Fetch the complete documentation index at: https://help.nextmatter.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect to Gmail no-code

> Exchange information between Gmail and your workflow in a completety no-code way.

## Before you begin

* Connect Google services in Next Matter with a service account and share data with this account. [Learn more...](/docs/integrate-with-google)
* Check the [required scopes](/docs/security-matrix) to learn more about which data is shared between the apps.

## Send email

The Gmail integration enables you to send emails using your domain. However, you can only use one Gmail account (the one you connect the integration with) to send the emails.

1. Click **Workflows > + Create new\... > Create a new workflow** and give your workflow a name. If you have a workflow ready, click **... > Edit workflow**.
2. Click **+ Add step** and select **Integrations > Gmail**.
3. Click the step and click **Configure integration**.
4. In the operation dropdown, select **Send email**.
5. Enter recipients (comma-separated), and email title.
6. Enter the email body in plain text.
7. (Optional) Add links to any attachments you want to send. The attachments can be data references, if the files are hosted on Next Matter, or can be links to publicly accessible files.
8. Save your changes.

**Tip**: Select and save `message ID` as a variable. You might need it if you want to reply by using the **Reply to email** no-code step in the same workflow.

## Reply to email

1. Click **Workflows > + Create new\... > Create a new workflow** and give your workflow a name. If you have a workflow ready, click **... > Edit workflow**.
2. Click **+ Add step** and select **Integrations > Gmail**.
3. Click the step and click **Configure integration**.
4. In the operation dropdown, select **Reply to email**.
5. Select `email ID` from the list of data references. It will be on the list if you've used the **Send email** no-code operation earlier in the workflow and saved the `email ID` as a variable to use in later steps.
6. Enter the email body in plain text.
7. (Optional) Select a label that should be applied to the email. The label needs to already exist in your email account.
8. (Optional) Add links to any attachments you want to send. The attachments can be data references, if the files are hosted on Next Matter, or can be links to publicly accessible files.
9. Save your changes.

## Add label to email

1. Click **Workflows > + Create new\... > Create a new workflow** and give your workflow a name. If you have a workflow ready, click **... > Edit workflow**.
2. Click **+ Add step** and select **Integrations > Gmail**.
3. Click the step and click **Configure integration**.
4. In the operation dropdown, select **Add label to email**.
5. Select `email ID` from the list of data references. It will be on the list if you've used the **Send email** no-code operation earlier in the workflow and saved the `email ID` as a variable to use in later steps.
6. Select a label that should be applied to the email. The label needs to already exist in your email account.
7. Save your changes.

## Get emails

1. Click **Workflows > + Create new\... > Create a new workflow** and give your workflow a name. If you have a workflow ready, click **... > Edit workflow**.
2. Click **+ Add step** and select **Integrations > Gmail**.
3. Click the step and click **Configure integration**.
4. In the operation dropdown, select **Get emails**.
5. To find the correct emails, enter at least one of the filtering criteria: From email (enter the email of the sender), To email (enter the email of the recipient), Label, Subject, After (enter date in the YYYY/MM/DD format), or Before (enter date the YYYY/MM/DD format). **Tip**: Alternatively you can leave the filters empty and enter a **custom Gmail query**. For example: `from:service@[company-domain].com after:2023/01/01 subject:Update` Custom query overwrites all other filters. For details on Gmail queries, see [Gmail documentation](https://support.google.com/mail/answer/7190).
6. Toggle on if you only want to retrieve unread emails.
7. Specify the maximum number of expected results.
8. Save your changes.
