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 从公开仓库中收录这些内容。

举报或申请下架