$npx -y skills add googleworkspace/cli --skill recipe-save-email-to-docSave a Gmail message body into a Google Doc for archival or reference.
| 1 | # Save a Gmail Message to Google Docs |
| 2 | |
| 3 | > **PREREQUISITE:** Load the following skills to execute this recipe: `gws-gmail`, `gws-docs` |
| 4 | |
| 5 | Save a Gmail message body into a Google Doc for archival or reference. |
| 6 | |
| 7 | ## Steps |
| 8 | |
| 9 | 1. Find the message: `gws gmail users messages list --params '{"userId": "me", "q": "subject:important from:boss@company.com"}' --format table` |
| 10 | 2. Get message content: `gws gmail users messages get --params '{"userId": "me", "id": "MSG_ID"}'` |
| 11 | 3. Create a doc with the content: `gws docs documents create --json '{"title": "Saved Email - Important Update"}'` |
| 12 | 4. Write the email body: `gws docs +write --document-id DOC_ID --text 'From: boss@company.com |
| 13 | Subject: Important Update |
| 14 | |
| 15 | [EMAIL BODY]'` |