用途:本配方用于创建 Gmail 过滤器,让收到的邮件自动被打标签、加星或分类。执行前需先加载 gws-gmail 技能。
主要步骤:先列出已有标签,命令为 gws gmail users labels list --params '{"userId": "me"}' --format table;再创建新标签,命令为 gws gmail users labels create --params '{"userId": "me"}' --json '{"name": "Receipts"}';然后创建过滤器,命令为 gws gmail users settings filters create --params '{"userId": "me"}' --json '{"criteria": {"from": "receipts@example.com"}, "action": {"addLabelIds": ["LABEL_ID"], "removeLabelIds": ["INBOX"]}}',其中 LABEL_ID 需替换为上一步得到的实际标签 ID;最后验证过滤器,命令为 gws gmail users settings filters list --params '{"userId": "me"}' --format table。
适用场景:需要按发件人等条件自动归档、打标签或加星 Gmail 来信时使用。限制:资料仅给出示例条件与动作,未说明其他过滤条件、权限要求或使用上限,暂未提供。