Recipe Label And Archive Emails

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

Apply Gmail labels to matching messages and archive them to keep your inbox clean.

AI 產生的概覽

為符合條件的 Gmail 郵件加上標籤並將其封存,以保持收件匣整潔。

功能
此配方描述一套三步驟的 Gmail 工作流程:搜尋符合查詢條件的郵件、為郵件加上標籤,以及透過移除 INBOX 標籤將其封存。它會產生已加標籤並已封存的 Gmail 會話串。它僅包含指示,不隨附指令碼。
適用情境
當你需要整理符合搜尋條件的 Gmail 郵件(例如來自特定寄件者的通知)時使用。它適合將郵件加標籤並移出收件匣的日常收件匣清理工作。
執行需求
需要 gws 命令列工具,並需載入 gws-gmail 技能。需要 Gmail 帳戶存取權來列出與修改郵件。不包含指令碼。

Label and Archive Gmail Threads

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

Apply Gmail labels to matching messages and archive them to keep your inbox clean.

Steps

  1. Search for matching emails: gws gmail users messages list --params '{"userId": "me", "q": "from:[email protected]"}' --format table
  2. Apply a label: gws gmail users messages modify --params '{"userId": "me", "id": "MESSAGE_ID"}' --json '{"addLabelIds": ["LABEL_ID"]}'
  3. Archive (remove from inbox): gws gmail users messages modify --params '{"userId": "me", "id": "MESSAGE_ID"}' --json '{"removeLabelIds": ["INBOX"]}'

來源與署名

來源:googleworkspace/cli位於skills/recipe-label-and-archive-emails提交a3768d0

授權條款: 無授權條款

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

檢舉或申請下架