Voltar ao índice
IA e agentes Fonte oficial

Compartilhar arquivo do Drive por email

Localiza um arquivo no Google Drive, concede acesso ao destinatário e envia o link correspondente pelo Gmail.

Ver código no GitHub Instala diretamente do repositório-fonte.

O que esta skill faz

Esta receita usa gws-drive e gws-gmail para compartilhar um arquivo com uma pessoa específica. O fluxo pesquisa pelo arquivo, cria uma permissão de leitura e envia uma mensagem contendo o link.

Quando usar

  • Enviar um relatório do Drive a um cliente
  • Conceder leitura antes de divulgar um documento
  • Compartilhar um arquivo com uma mensagem contextual

Como usar

  1. Carregue gws-drive e gws-gmail
  2. Localize o arquivo e confirme o FILE_ID correto
  3. Revise destinatário, função de acesso e mensagem
  4. Crie a permissão e confirme antes de enviar o email

O que revisar antes de instalar

  • Pesquisar apenas pelo nome pode retornar arquivos semelhantes
  • A permissão concedida altera o acesso ao arquivo
  • O link deve corresponder ao tipo real do arquivo compartilhado

SKILL.md

---
name: recipe-email-drive-link
description: "Share a Google Drive file and email the link with a message to recipients."
metadata:
  version: 0.22.5
  openclaw:
    category: "recipe"
    domain: "productivity"
    requires:
      bins:
        - gws
      skills:
        - gws-drive
        - gws-gmail
---

# Email a Google Drive File Link

> **PREREQUISITE:** Load the following skills to execute this recipe: `gws-drive`, `gws-gmail`

Share a Google Drive file and email the link with a message to recipients.

## Steps

1. Find the file: `gws drive files list --params '{"q": "name = '\''Quarterly Report'\''"}'`
2. Share the file: `gws drive permissions create --params '{"fileId": "FILE_ID"}' --json '{"role": "reader", "type": "user", "emailAddress": "client@example.com"}'`
3. Email the link: `gws gmail +send --to client@example.com --subject 'Quarterly Report' --body 'Hi, please find the report here: https://docs.google.com/document/d/FILE_ID'`