feat: add template for email

This commit is contained in:
2026-10-08 12:59:01 +02:00
parent b336580040
commit 6f237a937a
11 changed files with 337 additions and 47 deletions
+37
View File
@@ -0,0 +1,37 @@
# Email templates
Each email the API sends is a pair of files in this folder:
| File | Purpose |
|---|---|
| `<name>.html` | The email itself. Its `<title>` is used as the subject line. |
| `<name>.txt` | Optional plain-text version, shown by mail clients that don't render HTML. |
Templates are read from disk every time an email is sent, so edits apply without restarting the API.
To keep them outside the image, mount a folder and point `EMAIL_TEMPLATES_DIR` at it.
## Placeholders
Write `{{name}}` to insert a value. Values are HTML-escaped in the `.html` file (and the subject),
and inserted as-is in the `.txt` file. A placeholder without a value stops the email from being sent,
so a typo never reaches a customer.
### `payment-reminder`
Sent by "Send reminders" to customers with an unpaid balance.
| Placeholder | Example |
|---|---|
| `{{customerName}}` | Jan Peeters |
| `{{venueName}}` | Café De Kroon |
| `{{amount}}` | €12.50 |
| `{{itemCount}}` | 3 |
### `test-email`
Sent by the test button next to a customer's email address.
| Placeholder | Example |
|---|---|
| `{{customerName}}` | Jan Peeters |
| `{{venueName}}` | Café De Kroon |