Makes one personalised letter per person from a Word template and a list; nothing is sent.
Say it in your own words; the assistant finds this recipe by itself. Examples:
One letter template plus a list of people → one personalised letter per person, in ONE command: a Word template with {{name}}-style placeholders and a CSV or Excel list of recipients become one .docx and/or PDF per person (a folder or a zip), or one combined document with a letter per page, ready to print, sign or attach. Nothing is sent anywhere. Also checks that the list's columns match the template's placeholders before you run it. This is what Word calls mail merge, done for you. Use for: send the same letter to 200 customers with their names, personalised offers, price-change letters, invitations, certificates, serial letters, brevfletning, massebreve, standardbreve. Triggers: letters to everyone on this list, personalised letters, one letter per customer, mail merge, serial letter, template plus list, brevfletning, fletbreve, standardbrev til alle.
python3 /skills/bulk-letters/scripts/letters.py <verb> …. The template is a normal Word file
with placeholders written as {{name}}, <<name>> or «name» anywhere in the body, tables,
headers or footers. The list is a CSV (comma, semicolon or tab) or an Excel file whose column
headers are the placeholder names. Inputs are in /work/in, results in /work/out. Every verb
prints one OK … line or one ERROR … line. Nothing is e-mailed or sent.
| Need | Command |
|---|---|
| Which placeholders does the template use | letters.py fields /work/in/template.docx |
| Does the list have a column for each placeholder | letters.py check /work/in/template.docx /work/in/people.csv |
| One Word letter per person | letters.py merge /work/in/template.docx /work/in/people.csv /work/out/letters |
| One PDF per person, zipped | letters.py merge /work/in/template.docx /work/in/people.xlsx /work/out/letters --pdf --zip /work/out/letters.zip |
| Both docx and PDF per person | … --docx --pdf |
| One combined document, a letter per page | … --combined /work/out/all-letters.docx |
| Name the files after another column | … --name-field customer_no |
| Try the first 3 before running all | … --limit 3 |
Files are named after the name (or navn) column, or --name-field. Formatting of the
template is kept (the placeholder takes the formatting of the text around it). Always run
check first when the list did not come from the same person as the template; a missing
column is reported before anything is written. Give the person the zip or folder link; a
200-letter run takes well under a minute.
SKILL.mdgate.jsonscripts/__pycache__/letters.cpython-311.pycscripts/__pycache__/letters.cpython-313.pycscripts/letters.pyWritten by Percerno, MIT licence.