feat: change email template + add list of items

This commit is contained in:
2026-10-09 09:30:26 +02:00
parent 6f237a937a
commit 5246aeabc1
17 changed files with 474 additions and 55 deletions
+27 -2
View File
@@ -16,6 +16,25 @@ Write `{{name}}` to insert a value. Values are HTML-escaped in the `.html` file
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.
### Blocks
`{{#name}} ... {{/name}}` does one of two things, depending on the value:
- **A list** repeats the block once per item. Inside it you can use that item's placeholders
(and every placeholder from outside the block).
- **Anything else** shows the block only when the value is set (e.g. `true`), and hides it otherwise.
```html
{{#hasItems}}
<p>Overzicht van je poef:</p>
<table>
{{#items}}<tr><td>{{quantity}}x {{productName}}</td><td>{{lineTotal}}</td></tr>{{/items}}
</table>
{{/hasItems}}
```
Amounts are already formatted the Belgian way (`€ 25,00`).
### `payment-reminder`
Sent by "Send reminders" to customers with an unpaid balance.
@@ -24,8 +43,14 @@ Sent by "Send reminders" to customers with an unpaid balance.
|---|---|
| `{{customerName}}` | Jan Peeters |
| `{{venueName}}` | Café De Kroon |
| `{{amount}}` | €12.50 |
| `{{itemCount}}` | 3 |
| `{{amount}}` | € 29,00 |
| `{{itemCount}}` | 12 |
| `{{#hasItems}}…{{/hasItems}}` | Shown when the tab's lines are known. Terminals on an older app version don't report them. |
| `{{#items}}…{{/items}}` | Repeated for each line on the tab, with: |
| &nbsp;&nbsp;`{{quantity}}` | 10 |
| &nbsp;&nbsp;`{{productName}}` | Cola |
| &nbsp;&nbsp;`{{unitPrice}}` | € 2,50 |
| &nbsp;&nbsp;`{{lineTotal}}` | € 25,00 |
### `test-email`