Skip to content

Example - WHAT TO DO WITH PHIL'S EMAILS?

Last edited 200 days ago by Christine Dahl.
Christine's example presents a system to automate the organization and indexing of valuable email attachments received from events, such as the London Summit 2025. The proposed solution involves creating a Gmail filter for relevant messages and using Google Workspace tools to save these attachments in a timestamped Google Drive folder. A Google Sheet will serve as an index, cataloging metadata like the sender, subject, and a link to the stored file, thereby ensuring that attachments are easily searchable and do not get duplicated. Additionally, assigning a team member to audit the system will maintain its functionality and relevance. A provided Google Apps Script automates the process by searching Gmail for specific messages, downloading attachments to Drive, preventing duplicates, and updating the Google Sheet index with necessary metadata. To implement this, one needs to set up a Google Sheet and a Drive folder before running the script. Optional improvements include setting a daily trigger for the script and adding variables for a more generic approach.

about-us-female

LET'S MAKE AN EXAMPLE STEP BY STEP PROMPT FOR OUR LONDON AUDIENCE

- automate this! They have received a series of emails with event attachments - examples - these are very valuable and people will want to find them later EXAMPLE: phil@internationaltaxlaw.com <phil@internationaltaxlaw.com> via n.convertkit.com [London Summit 2025] Materials 03 - Mityaeva - PHC Presentation Slides v2 27 06 25 let's start with suggestions how to make a system that 1 - creates an index of the emails 2 - stores the attachments in a designated folder ​ Before we start, please review this idea and suggest some business process management improvements for this example to provide excellent automation & knowledge management Assume google workspace tools
about
Excellent use case, Christine — you're identifying a common but messy pain point and framing it as a teachable moment for automation and knowledge management. Below is a structured response in three parts:

🔍 Review of the Automation Idea: Index & Store Email Attachments from an Event Series

🧩 Use Case Summary

You're receiving valuable event-related materials (e.g., presentation slides) by email — often from a recurring sender (phil@internationaltaxlaw.com via ConvertKit), with a consistent subject prefix ([London Summit 2025]). These attachments need to be:
Saved in a centralized folder (e.g., Google Drive),
Indexed with metadata (sender, subject, date received, attachment names),
Searchable later (for reuse, sharing, compliance, etc.).

✅ Goals

Reduce inbox clutter while ensuring nothing is lost
Turn scattered emails into structured, retrievable knowledge assets
Teach professionals how to turn friction into flow using automation
🛠️ Business Process Management Enhancements
There are no rows in this table

🔁 Step-by-Step Example Automation (Using Google Workspace Tools)

We’ll draft a sample prompt (below) that you can customize for your audience in London — inviting them to try building this using Apps Script or prompting ChatGPT to help them scaffold it.

🎤 “Talk-Along” Prompt for Workshop Participants:

“I want to automate the collection of event-related materials from my email.”
Here’s the context:
I receive multiple emails from phil@internationaltaxlaw.com via ConvertKit.
Each email contains valuable attachments with [London Summit 2025] in the subject.
I want to automatically:
Move the attachments to a specific folder in Google Drive.
Create or update a Google Sheet index of these emails with the following columns:
Subject line
Sender email
Date received
File names
Google Drive link(s)
Constraints:
I don’t want to store the same attachment multiple times.
I use Google Workspace (Gmail, Google Drive, and Google Sheets).
Can you walk me through how to set this up using Google Apps Script? Bonus points if you can help me make it flexible enough to use for other event series in the future.
ask-question
Would you like the full Google Apps Script template next — or a visual handout that maps this as a workflow diagram?
Excellent. Below is a complete Google Apps Script that:
Searches Gmail for messages matching [London Summit 2025] from a specific sender.
Downloads attachments to a target Google Drive folder.
Prevents duplicates using message ID + attachment name.
Updates a Google Sheet index with metadata and download links.

✅ Before You Start

🔧 Setup Required:

Create a Google Sheet titled London Summit Email Index with this header row in the first sheet:
Date Received | Sender | Subject | File Name | Drive URL | Gmail Message ID

Create a Google Drive folder to store attachments. Copy its Folder ID.

📜 Google Apps Script (paste into Apps Script Editor in the Sheet)

function saveSummitAttachments() {
const DRIVE_FOLDER_ID = 'YOUR_FOLDER_ID_HERE'; // Replace with actual folder ID
const SHEET_NAME = 'Sheet1'; // Or name of your sheet
const QUERY = 'from:phil@internationaltaxlaw.com subject:"[London Summit 2025]" has:attachment';
const folder = DriveApp.getFolderById(DRIVE_FOLDER_ID);
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(SHEET_NAME);
const existingRows = sheet.getDataRange().getValues();
// Build a set of existing entries to prevent duplicates
const processedKeys = new Set();
for (let i = 1; i < existingRows.length; i++) {
processedKeys.add(existingRows[i][5] + '|' + existingRows[i][3]); // MessageID|FileName
}

const threads = GmailApp.search(QUERY);
threads.forEach(thread => {
const messages = thread.getMessages();
messages.forEach(message => {
const msgId = message.getId();
const date = message.getDate();
const subject = message.getSubject();
const sender = message.getFrom();
const attachments = message.getAttachments();
attachments.forEach(att => {
const key = msgId + '|' + att.getName();
if (!processedKeys.has(key)) {
const file = folder.createFile(att.copyBlob()).setName(att.getName());
const url = file.getUrl();

sheet.appendRow([
date,
sender,
subject,
att.getName(),
url,
msgId
]);
processedKeys.add(key);
}
});
});
});
}

🧠 Optional Improvements

Set a daily time trigger to run the script automatically.
Replace the sender/email/subject with variables if making a generic version.
Add logging or email alerts if needed for auditability.
Would you like a version of this as a printable handout with diagram + use case + walkthrough

ChatGPT Image Jun 27, 2025, 11_09_44 AM.png


Want to print your doc?
This is not the way.
Try clicking the ··· in the right corner or using a keyboard shortcut (
CtrlP
) instead.