# MailMergeTemplate Interface

> MailMergeTemplate interface in the Node.js TypeScript API: Captures template state and produces isolated merged workbooks without browser UI.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Interface
- **Path:** TX Sheet Control > API Reference > TypeScript API > Node.js Server > MailMergeTemplate Interface
- **442 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/mailmergetemplate/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/mailmergetemplate/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/mailmergetemplate/llms-full.txt

---

Captures template state and produces isolated merged workbooks without browser UI.

Package: `@txtextcontrol/tx-sheet-control-server`. Version: **2.0.0**.

Related workbook object-model type, returned through the server control. Obtain it from its owning workbook or collection; it is not a required browser-package import.

### Members

#### Properties

| Property | Description |
|---|---|
| [events](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/mailmergetemplate/events-property/llms-full.txt) | File lifecycle notifications for each save of the captured template. |

#### Methods

| Method | Description |
|---|---|
| [merge](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/mailmergetemplate/merge-method/llms-full.txt) | The merge operation of MailMergeTemplate. |
| [save](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/mailmergetemplate/save-method/llms-full.txt) | Saves the captured template through the same format dispatcher as a workbook. |

### Examples

Pass the MailMergeTemplate value obtained from its owning control, collection, callback or operation. The function reads that value without constructing a replacement document object.

```typescript
import type { ServerSheetControl } from '@txtextcontrol/tx-sheet-control-server';

function inspectMailMergeTemplateEvents(
    mailMergeTemplate: Awaited<ReturnType<ServerSheetControl['workbook']['createMailMergeTemplate']>>,
) {
    const value = mailMergeTemplate['events'];
    console.log('MailMergeTemplate.events', value);
}
```

### See Also

- [TypeScript Node.js Server API](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/llms-full.txt)
- [Mail Merge With JSON](https://docs.textcontrol.com/tx-sheet-control/mail-merge/overview/llms-full.txt)

---

## In This Section

- [MailMergeTemplate.events Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/mailmergetemplate/events-property/llms-full.txt): MailMergeTemplate.events property in the TX Sheet Control TypeScript API for Node.js: File lifecycle notifications for each save of the captured template.
- [MailMergeTemplate.merge Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/mailmergetemplate/merge-method/llms-full.txt): MailMergeTemplate.merge method in the TX Sheet Control TypeScript API for Node.js, with the return type Promise<MailMergeResult> and a TypeScript example.
- [MailMergeTemplate.save Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/mailmergetemplate/save-method/llms-full.txt): MailMergeTemplate.save method in the TX Sheet Control TypeScript API for Node.js: Saves the captured template through the same format dispatcher as a workbook.

---

## Nearby

- **Previous:** [MailMergeSourceField.type Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/mailmergesourcefield/type-property/llms-full.txt)
- **Next:** [MailMergeTemplate.events Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/mailmergetemplate/events-property/llms-full.txt)
