Docs 1,665 installs

Save a Gmail Message to Google Docs

by googleworkspace/cli

Save a Gmail message body into a Google Doc for archival or reference.

Skill content

Save Gmail messages to Google Docs for archival and reference.

- Requires gws-gmail and gws-docs skills to be loaded

- Workflow: search Gmail by query, retrieve message content, create a new Google Doc, and append the email body as formatted text

- Supports filtering by subject, sender, and other Gmail query parameters for targeted message selection

Save a Gmail Message to Google Docs

PREREQUISITE: Load the following skills to execute this recipe: gws-gmail, gws-docs

Save a Gmail message body into a Google Doc for archival or reference.

Steps

- Find the message: gws gmail users messages list --params '{"userId": "me", "q": "subject:important from:[email protected]"}' --format table

- Get message content: gws gmail users messages get --params '{"userId": "me", "id": "MSG_ID"}'

- Create a doc with the content: gws docs documents create --json '{"title": "Saved Email - Important Update"}'

- Write the email body: `gws docs +write --document-id DOC_ID --text 'From: [email protected]
Subject: Important Update

[EMAIL BODY]'`