SKILL.md
readonlyread-only
name
recipe-save-email-attachments
description
尋找 Gmail 中含有附件的郵件,並將其儲存到 Google Drive 資料夾。
將 Gmail 附件儲存到 Google Drive
前置條件: 載入以下技能以執行此配方:
gws-gmail、gws-drive
尋找 Gmail 中含有附件的郵件,並將其儲存到 Google Drive 資料夾。
步驟
- 搜尋含有附件的郵件:
gws gmail users messages list --params '{"userId": "me", "q": "has:attachment from:client@example.com"}' --format table - 取得郵件詳細資訊:
gws gmail users messages get --params '{"userId": "me", "id": "MESSAGE_ID"}' - 下載附件:
gws gmail users messages attachments get --params '{"userId": "me", "messageId": "MESSAGE_ID", "id": "ATTACHMENT_ID"}' - 上傳到 Drive 資料夾:
gws drive +upload --file ./attachment.pdf --parent FOLDER_ID






