Mail merge letters from a spreadsheet
mail_mergeMerge recipient data from CSV, TSV, TXT, XLSX, or ODS files into personalized letters, certificates, or notices via templates or {{Field}} placeholders; output DOCX/PDF with one section per record.
Instructions
Personalized letters, certificates or notices from a data file (CSV, TSV, TXT, XLSX, ODS): either a template document that already has merge fields, or a body written here with {{Field}} placeholders (the column names). Writes one merged document with a section per record (docx, and pdf / other formats if asked).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | Paragraphs of the letter when there is no template, e.g. ["Dear {{Name}},", "Your order {{Order}} ships on {{Date}}."]. | |
| name | No | merged | |
| scale | No | png only: pixels per point (default 2 ≈ 144 dpi). | |
| markup | No | Print Markup: tracked changes marked up and comments beside each page (pdf / png), a comment list (html / md / txt). | |
| formats | No | Outputs: docx (Word, editable), pdf, odt (OpenDocument), rtf, html, md (Markdown), tex (LaTeX), txt, json (WordCraft document model) and png (one image per page: <name>_p1.png...). | |
| heading | No | Optional heading above the body (may use {{Field}} too). | |
| password | No | docx only: encrypt the saved document with this password. | |
| data_path | Yes | Absolute path of the recipient list (first row = column names). | |
| overwrite | No | Replace existing outputs. | |
| to_record | No | ||
| output_dir | No | Absolute output folder (default: next to the input; required for new documents). | |
| from_record | No | ||
| output_path | No | Absolute output file for the first format (its extension must match). | |
| export_pages | No | png only: pages to render, 1-based: "1-3,5" (default all). | |
| template_path | No | Absolute .docx with merge fields (e.g. made in Word or by a previous run). |