用途:在 Gmail 中检索带附件的邮件,并将附件下载后上传到指定的 Google Drive 文件夹。
前置条件:执行该 recipe 前需先加载 gws-gmail 和 gws-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
限制:资料未提供更多关于权限、配额、支持附件类型或错误处理的信息。