Recipe Create Gmail Filter
googleworkspace/cliThis skill enables the creation of Gmail filters that automatically categorize, label, or star incoming messages based on specified criteria. It offers capabilities to list existing labels, create new labels, and set up filters with customizable actions, making email management more efficient. Designed for users seeking automated email organization, it integrates seamlessly with Google Workspace through command-line interactions.
Create a Gmail Filter
PREREQUISITE: Load the following skills to execute this recipe:
gws-gmailCreate a Gmail filter to automatically label, star, or categorize incoming messages.
Steps
- List existing labels:
gws gmail users labels list --params '{"userId": "me"}' --format table - Create a new label:
gws gmail users labels create --params '{"userId": "me"}' --json '{"name": "Receipts"}' - Create a filter:
gws gmail users settings filters create --params '{"userId": "me"}' --json '{"criteria": {"from": "receipts@example.com"}, "action": {"addLabelIds": ["LABEL_ID"], "removeLabelIds": ["INBOX"]}}' - Verify filter:
gws gmail users settings filters list --params '{"userId": "me"}' --format table
GitHub Owner
Owner: googleworkspace
GitHub Links
- Website: https://developers.google.com/workspace
- Twitter: https://twitter.com/workspacedevs
SKILL.md
name: recipe-create-gmail-filter version: 1.0.0 description: "Create a Gmail filter to automatically label, star, or categorize incoming messages." metadata: openclaw: category: "recipe" domain: "productivity" requires: bins: ["gws"] skills: ["gws-gmail"]
Create a Gmail Filter
PREREQUISITE: Load the following skills to execute this recipe:
gws-gmailCreate a Gmail filter to automatically label, star, or categorize incoming messages.
Steps
- List existing labels:
gws gmail users labels list --params '{"userId": "me"}' --format table - Create a new label:
gws gmail users labels create --params '{"userId": "me"}' --json '{"name": "Receipts"}' - Create a filter:
gws gmail users settings filters create --params '{"userId": "me"}' --json '{"criteria": {"from": "receipts@example.com"}, "action": {"addLabelIds": ["LABEL_ID"], "removeLabelIds": ["INBOX"]}}' - Verify filter:
gws gmail users settings filters list --params '{"userId": "me"}' --format table