# Gmail Query Patterns ## Basic Queries | Request | Gmail Query | |---------|-------------| | Unread | `is:unread` | | Last N days | `newer_than:Nd` | | From sender | `from:email@example.com` | | To recipient | `to:email@example.com` | | With attachments | `has:attachment` | | Important | `is:important` | | Starred | `is:starred` | | In inbox | `in:inbox` | ## Urgent/Priority | Pattern | Query | |---------|-------| | Urgent keywords | `subject:(urgent OR asap OR "action required")` | | Important + unread | `is:important is:unread` | | Time-sensitive | `subject:(deadline OR "due date" OR "end of day")` | ## Sender Patterns | Pattern | Query | |---------|-------| | GitHub notifications | `from:github.com` | | Google alerts | `from:googlealerts-noreply@google.com` | | Calendar invites | `from:calendar-notification@google.com` | | Newsletters | `category:promotions` | ## Combining Queries Queries can be combined: ``` is:unread newer_than:7d from:github.com is:unread (subject:urgent OR is:important) newer_than:3d has:attachment from:client@example.com newer_than:30d ``` ## Date Queries | Pattern | Query | |---------|-------| | Last 24 hours | `newer_than:1d` | | Last week | `newer_than:7d` | | Last month | `newer_than:30d` | | Specific date | `after:2024/01/01 before:2024/01/31` | ## Size Queries | Pattern | Query | |---------|-------| | Large attachments | `larger:10M` | | Small emails | `smaller:100K` |