---
id: ssh2-recipe-save-email-to-doc
name: "recipe-save-email-to-doc"
url: https://skills.yangsir.net/skill/ssh2-recipe-save-email-to-doc
author: googleworkspace
domain: ai-productivity-automation
tags: ["gmail-to-google-docs", "email-archiving", "document-management", "content-preservation", "google-workspace"]
install_count: 30300
rating: 4.60 (20 reviews)
github: https://github.com/googleworkspace/cli
---

# recipe-save-email-to-doc

> 将Gmail邮件正文保存到Google文档中，用于归档、记录或进一步编辑和分享。

**Stats**: 30,300 installs · 4.6/5 (20 reviews)

## Before / After 对比

### 快速归档邮件内容，方便查阅参考。

## Readme

# 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

1. Find the message: `gws gmail users messages list --params '{"userId": "me", "q": "subject:important from:boss@company.com"}' --format table`
2. Get message content: `gws gmail users messages get --params '{"userId": "me", "id": "MSG_ID"}'`
3. Create a doc with the content: `gws docs documents create --json '{"title": "Saved Email - Important Update"}'`
4. Write the email body: `gws docs +write --document-id DOC_ID --text 'From: boss@company.com
Subject: Important Update

[EMAIL BODY]'`



---
*Source: https://skills.yangsir.net/skill/ssh2-recipe-save-email-to-doc*
*Markdown mirror: https://skills.yangsir.net/api/skill/ssh2-recipe-save-email-to-doc/markdown*