SuperAPI AI 工具集

recipe-save-email-attachments

办公与效率

查看项目

更新于 10-16 04:16

技能介绍

用途:查找 Gmail 中带附件的邮件,并将附件保存到 Google Drive 文件夹。

前置条件:执行此配方前,需先加载以下技能:gws-gmail、gws-drive。

主要步骤:

  1. 搜索带附件的邮件: gws gmail users messages list --params '{"userId": "me", "q": "has:attachment from:client@example.com"}' --format table
  2. 获取邮件详情: gws gmail users messages get --params '{"userId": "me", "id": "MESSAGE_ID"}'
  3. 下载附件(使用 -o 直接保存到磁盘): gws gmail users messages attachments get --params '{"userId": "me", "messageId": "MESSAGE_ID", "id": "ATTACHMENT_ID"}' -o attachment.pdf
  4. 上传到 Drive 文件夹: gws drive +upload --file ./attachment.pdf --parent FOLDER_ID

适用场景:需要将 Gmail 邮件中的附件批量或按条件转存到 Google Drive 时使用。

限制:资料未提供更多关于权限、配额、错误处理或平台支持范围的说明。