用途:在 Gmail 中搜索带附件的邮件,把附件下载后上传到 Google Drive 的指定文件夹,适合需要批量归档客户邮件附件的场景。
前置条件:执行前需先加载 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
限制:资料未提供支持的平台、收费方式、附件大小限制、错误处理及权限配置等细节,暂未提供。