Recipe Create Gmail Filter

作者 googleworkspacea3768d0e82ad無授權條款31K 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫昨天更新

Create a Gmail filter to automatically label, star, or categorize incoming messages.

AI 產生的概覽

透過 gws 指令建立 Gmail 篩選器,自動為收到的郵件加上標籤、加星號或分類。

功能
這個配方說明如何使用 gws 命令列工具設定 Gmail 郵件自動化。它會列出既有標籤、建立新標籤、建立帶有條件與動作(例如加上標籤或將郵件移出收件匣)的篩選器,然後列出篩選器進行驗證。產出是設定好的 Gmail 標籤與篩選器,而不是檔案或文件。
適用情境
當你希望來自特定寄件者或符合特定條件的 Gmail 郵件能自動加上標籤、加星號或分類時使用。它適合透過 gws 工具設定或檢查信箱整理規則。
執行需求
需要 gws 執行檔與 gws-gmail 技能;它會對已驗證的帳戶執行 Gmail API 指令,因此需要 Gmail 存取權與憑證。它不附帶指令碼,只有說明。

Create a Gmail Filter

PREREQUISITE: Load the following skills to execute this recipe: gws-gmail

Create a Gmail filter to automatically label, star, or categorize incoming messages.

Steps

  1. List existing labels: gws gmail users labels list --params '{"userId": "me"}' --format table
  2. Create a new label: gws gmail users labels create --params '{"userId": "me"}' --json '{"name": "Receipts"}'
  3. Create a filter: gws gmail users settings filters create --params '{"userId": "me"}' --json '{"criteria": {"from": "[email protected]"}, "action": {"addLabelIds": ["LABEL_ID"], "removeLabelIds": ["INBOX"]}}'
  4. Verify filter: gws gmail users settings filters list --params '{"userId": "me"}' --format table

來源與署名

來源:googleworkspace/cli位於skills/recipe-create-gmail-filter提交a3768d0

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架