> For the complete documentation index, see [llms.txt](https://docs.docbits.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.docbits.com/chinese/guan-li-yu-she-zhi/settings/global-settings/e-mail-templates.md).

# 电子邮件模板

## **概述**

电子邮件模板可让您自定义 DocBits 自动发送的电子邮件，例如审批提醒或错误通知。模板定义主题行和正文，并可包含动态字段（例如 `{{InvoiceNumber}}`）、图片和富文本格式。

## **访问电子邮件模板**

前往 **Settings → Communication & Notifications → Email Templates**。列表显示每个模板的 **Name**、**Subject**、**Document Type**、**Last Modified** 日期和 **Actions**（编辑或删除）。

<figure><img src="https://1870485400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlPczlNw8zzYNLfjfispX%2Fuploads%2Fgit-blob-3a71b73afb611f687549afd993c26d38a1e17e18%2Femail_templates_dashboard_list.png?alt=media" alt="电子邮件模板列表"><figcaption><p>电子邮件模板列表</p></figcaption></figure>

## **创建模板**

1. 点击右上角的 **+ New**。
2. 填写以下字段：
   * **Name** — 描述性标识（例如“文档错误通知”）。
   * **Document Type** — 此模板适用的文档类型（例如 `INVOICE`）。
   * **Include Document As Attachment** — 启用此开关，将源文档作为附件添加到电子邮件中。
   * **Subject** — 电子邮件主题行。点击字段旁边的 **+** 按钮可插入动态字段，也可以直接输入 `{{FieldID}}`。
3. 在富文本编辑器中设计正文 — 设置文本格式（粗体、斜体、列表、对齐方式），使用 **Upload** 插入图片，使用 `<>` 按钮编辑原始 HTML，并使用 **+** 按钮插入动态字段。
4. 点击 **Save**。

<figure><img src="https://1870485400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlPczlNw8zzYNLfjfispX%2Fuploads%2Fgit-blob-d27645781a1bde71d46b7aa9012f076bcb9f474f%2Femail_templates_4.png?alt=media" alt="电子邮件模板编辑器"><figcaption><p>模板编辑器 — 名称、文档类型、附件开关、主题和富文本正文</p></figcaption></figure>

## **动态字段**

发送电子邮件时，动态字段会替换为文档数据。使用 **+** 按钮插入字段，也可以手动输入双大括号格式：

* `{{invoice_id}}` — 发票编号
* `{{supplier_name}}` — 供应商名称
* `{{total_amount}}` — 总金额
* `{{status}}` — 当前文档状态

## **发送测试电子邮件**

在编辑器中点击 **Send Test**，输入 **Receiver Email** 地址，然后点击 **Send**。DocBits 会发送模板预览，以便您在保存前检查布局并确认动态字段能正确解析。

<figure><img src="https://1870485400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlPczlNw8zzYNLfjfispX%2Fuploads%2Fgit-blob-aff8d73af12815ebc17a5029c2572a81ef61ee0d%2Ftest_email_configuration_dialog.png?alt=media" alt="Send Test 对话框"><figcaption><p>Send Test 对话框</p></figcaption></figure>

## **在通知中使用模板**

已保存的模板可以关联到 [**Email Notification**](/chinese/guan-li-yu-she-zhi/settings/global-settings/email-notification.md) 工作流中，例如审批提醒或状态变更更新。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.docbits.com/chinese/guan-li-yu-she-zhi/settings/global-settings/e-mail-templates.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
