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 |
@@ -0,0 +1,13 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Payment reminder for your tab at {{venueName}}</title>
</head>
<body>
<p>Hi {{customerName}},</p>
<p>This is a friendly reminder that you have an open tab of <strong>{{amount}}</strong> at {{venueName}} (items: {{itemCount}}).</p>
<p>Please settle your tab at the bar at your earliest convenience.</p>
<p>Thank you!</p>
</body>
</html>
@@ -0,0 +1,7 @@
Hi {{customerName}},
This is a friendly reminder that you have an open tab of {{amount}} at {{venueName}} (items: {{itemCount}}).
Please settle your tab at the bar at your earliest convenience.
Thank you!
+14
View File
@@ -0,0 +1,14 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Test email from {{venueName}}</title>
</head>
<body>
<p>Hi {{customerName}},</p>
<p>This is a test email from {{venueName}} to verify that email reminders are working correctly.</p>
<p>If you received this, the email configuration is working!</p>
<hr>
<p style="color: #888; font-size: 12px;">This is a test — no action needed.</p>
</body>
</html>
+8
View File
@@ -0,0 +1,8 @@
Hi {{customerName}},
This is a test email from {{venueName}} to verify that email reminders are working correctly.
If you received this, the email configuration is working!
--
This is a test — no action needed.