Gmail · GPT-4o · Notion

gmail2notion

I hate getting rejection emails so I make AI read them for me. This script scans your inbox, extracts structured job data with GPT-4o, and keeps a Notion tracker up to date automatically.

How It Works

Three steps. Zero manual logging.

01

FETCH

Gmail

Authenticates via OAuth2 and searches your inbox for job-related subjects: applications, offers, interviews, rejections. Scans the last 7 days by default, configurable.

OAuth2Gmail APIKeyword filterDate window
02

EXTRACT

GPT-4o

Each email body is passed to GPT-4o with a structured prompt. It returns clean JSON with every relevant field or flags the email as not job-related and skips it.

Structured JSONRelevance filter9 fields extractedNo hallucination guardrails
03

LOG

Notion

Searches the database for an existing row matching the company. Updates it if found, creates a new row if not. Idempotent, so running it twice never creates duplicates.

Notion APIUpsert logicIdempotentTimestamped notes

Extraction Output

Every field GPT-4o pulls out

CompanyRoleApplication StatusPriority LevelNext StepFollow-Up DateContactReferral SourceNotes

If an email is not job-related, GPT-4o returns is_job_related: false and the script skips it entirely. No noise in your tracker.

Tech Stack

What it runs on

PythonGPT-4oGmail APINotion APIOAuth2python-dotenv

Set it up in 10 minutes.

Clone the repo, drop in your Gmail credentials and Notion API key, and run it. The README walks through every step.

Try it yourself