Recipe Save Email Attachments

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

Find Gmail messages with attachments and save them to a Google Drive folder.

AI 產生的概覽

尋找帶附件的 Gmail 郵件,並將附件儲存到 Google Drive 資料夾。

功能
這個配方逐步說明如何尋找帶附件的 Gmail 郵件、取得郵件詳細資料、下載附件,並把檔案上傳到指定的 Google Drive 資料夾。它是純指示型配方,依賴 gws 命令列工具以及 gws-gmail 和 gws-drive 技能。最終結果是附件被存入 Drive,而不是留在信箱中。
適用情境
當需要把電子郵件收到的附件收集並歸檔到 Google Drive 時使用。它適合把檔案從 Gmail 移到共用或整理好的 Drive 資料夾的工作流程。
執行需求
需要 gws 執行檔以及 gws-gmail 和 gws-drive 技能。需要已通過驗證的 Gmail 和 Google Drive 存取權,以及網路存取。不附帶指令碼,僅為指示。

Save Gmail Attachments to Google Drive

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

Find Gmail messages with attachments and save them to a Google Drive folder.

Steps

  1. Search for emails with attachments: gws gmail users messages list --params '{"userId": "me", "q": "has:attachment from:[email protected]"}' --format table
  2. Get message details: gws gmail users messages get --params '{"userId": "me", "id": "MESSAGE_ID"}'
  3. Download attachment: gws gmail users messages attachments get --params '{"userId": "me", "messageId": "MESSAGE_ID", "id": "ATTACHMENT_ID"}'
  4. Upload to Drive folder: gws drive +upload --file ./attachment.pdf --parent FOLDER_ID

來源與署名

來源:googleworkspace/cli位於skills/recipe-save-email-attachments提交a3768d0

授權條款: 無授權條款

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

檢舉或申請下架