Email Metadata Queries
Content: Email Metadata Queries
User Intent
Operation
Email Metadata Structure
interface EmailMetadata {
identifier: string; // Message-ID
threadIdentifier: string; // Thread ID
subject: string;
from: PersonReference[];
to: PersonReference[];
cc: PersonReference[];
bcc: PersonReference[];
labels: string[]; // Gmail labels
sensitivity: MailSensitivity;
priority: MailPriority;
importance: MailImportance;
attachmentCount: number;
unsubscribeUrl: string;
publicationName: string;
publicationUrl: string;
}TypeScript (Canonical)
Query Patterns
1. Find by Sender
2. Find by Subject
3. Find by Recipient
4. Filter by Labels (Gmail)
5. Date Range Queries
6. Thread Queries
7. With Attachments
8. Newsletter Detection
Sample Reference
Query emails
By sender
Recent emails
Access metadata
Developer Hints
Email Addresses are Searchable
Labels are Gmail-Specific
Thread Detection
Common Issues & Solutions
Production Example
Last updated