feat: change email template + add list of items
This commit is contained in:
@@ -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: |
|
||||
| `{{quantity}}` | 10 |
|
||||
| `{{productName}}` | Cola |
|
||||
| `{{unitPrice}}` | € 2,50 |
|
||||
| `{{lineTotal}}` | € 25,00 |
|
||||
|
||||
### `test-email`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user