MiN8T All Insights

Google Sheets: How to Pull Data from Google Sheets into Emails

M
MiN8T Team
Email Engineering

1 Overview

Instead of manually writing JSON, you can connect a Google Spreadsheet as a Data Source. MiN8T reads your spreadsheet via the Google Sheets API, converts the rows into items, and serves them through the same public endpoint used by AMP emails.

This means non-technical team members can update email content by editing a spreadsheet — no JSON knowledge, no code, no deployments. The email fetches the latest data every time it's opened.

The integration uses Google OAuth 2.0 for authorization. MiN8T requests read-only access to your spreadsheets — it can read data but cannot modify, create, or delete your sheets.

i

Google Sheets is an alternative source type for Data Sources. Everything about endpoints, editor integration, and Smart Elements works identically whether the underlying data comes from JSON or Google Sheets.

2 Preparing Your Spreadsheet

Structure your Google Sheet so MiN8T can convert it to the standard {"items": [...]} format:

Row 1: Column Headers

The first row must contain your field names. These become the mustache variables you use in templates:

| title          | url                | imgUrl                | price   | text                      |
|----------------|--------------------|-----------------------|---------|---------------------------|
| Samsung Galaxy | https://shop.com/s | https://cdn/sam.jpg   | $999    | The latest flagship phone |
| iPhone 15 Pro  | https://shop.com/i | https://cdn/iph.jpg   | $1199   | Pro camera. Pro display.  |
| Pixel 9        | https://shop.com/p | https://cdn/pixel.jpg | $899    | AI-first smartphone       |

Each subsequent row becomes one item in the data source. The column headers become {{title}}, {{url}}, {{imgUrl}}, {{price}}, and {{text}}.

Best Practices

3 Connecting via OAuth

Step 1: Create a Data Source

In the Data Sources dashboard, click "+ New Source" and enter a name (e.g., "Product Catalog"). Select the "Google Sheets" source type.

Step 2: Sign In with Google

Click "Sign in with Google". A popup window opens with Google's OAuth consent screen.

Step 3: Popup Closes Automatically

After authorization, Google redirects back to MiN8T. The popup window closes automatically and the Data Sources modal transitions to the spreadsheet picker view.

OAuth tokens are encrypted with AES-256-GCM before storage. MiN8T never sees your Google password — only the authorization token that Google provides. Tokens are automatically refreshed when they expire.

Security Details

4 Spreadsheet Picker

After OAuth authorization, the modal shows a list of all spreadsheets in your Google Drive.

Search & Sort

Select a Spreadsheet

Click on a spreadsheet name to select it. If the spreadsheet has multiple tabs (sheets), a second picker appears showing all available sheet tabs.

Select a Sheet Tab

Click on the specific sheet tab that contains your data. MiN8T reads the sheet and displays:

At this point, MiN8T reads the entire sheet data and stores it as JSON for immediate serving through the Data Source endpoint.

5 Column Headers as Variables

Once connected, your column headers are available as mustache variables throughout the MiN8T editor:

The same variables work identically whether the data comes from JSON or Google Sheets. The conversion is transparent — MiN8T normalizes everything to the {"items": [...]} format.

i

The column header names in your spreadsheet become the exact variable names. A column called imgUrl becomes {{imgUrl}}. A column called Product Name becomes {{Product Name}} (spaces included).

6 Updating Data

When your spreadsheet data changes, the Data Source endpoint will serve the updated content. The update flow:

  1. Edit your Google Spreadsheet normally (add rows, update prices, change URLs)
  2. MiN8T re-reads the sheet data when the endpoint is requested and the cache has expired
  3. Recipients who open your AMP email see the latest data from your spreadsheet

Cache Behavior

The Data Source endpoint caches the response for the configured Cache TTL (default: 5 minutes, range: 60–3600 seconds). This means:

!

Google Sheets API has usage quotas. If your emails generate many concurrent requests, consider setting a longer cache TTL to stay within limits. For very high-volume sends, exporting to JSON may be more reliable.

7 Disconnecting

To revoke MiN8T's access to your Google account:

  1. Open the Data Source that uses Google Sheets
  2. Click "Disconnect Google Sheets"
  3. MiN8T revokes the OAuth token and clears stored credentials

After disconnecting:

You can also revoke access from Google's side at myaccount.google.com → Security → Third-party apps.

8 Next Steps

Related guides:

Last updated: April 2026. All details verified against MiN8T's actual codebase implementation.