feat(termine+matrix): Nutzer-Termin-Einreichung (Draft) + Matrix-Notifications
Deploy / verify (push) Successful in 1m32s
Deploy / deploy (push) Successful in 1m54s

- /termin-melden: öffentliches Formular → /api/termin legt calendar_item als
  Draft an (scoped Write-Key), Admin bestätigt per draft→published
- /api/cms-webhook: empfängt RustyCMS-Webhooks (X-Webhook-Secret) → Matrix
- src/lib/server/matrix.ts: notifyMatrix() Helper
- Form-Proxies (stellungnahme/contact/newsletter/mitmachen) pingen Matrix
- deploy.yml: Matrix/Webhook/Termin-Key Env-Vars

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Peter Meier
2026-06-29 10:32:36 +02:00
parent 5b5fe8789e
commit ca4dfad8be
9 changed files with 390 additions and 0 deletions
+4
View File
@@ -1,6 +1,7 @@
import { json } from "@sveltejs/kit";
import { env as publicEnv } from "$env/dynamic/public";
import type { RequestHandler } from "./$types";
import { notifyMatrix } from "$lib/server/matrix";
// Honeypot field — must be empty (bot trap)
const HONEYPOT = "website";
@@ -97,6 +98,9 @@ export const POST: RequestHandler = async ({ request, getClientAddress }) => {
}
if (res.ok) {
void notifyMatrix(
`📄 Neue Stellungnahme-Einsendung: ${fields.name} (${fields.email})${fields.vorranggebiet ? `, Gebiet ${fields.vorranggebiet}` : ""} — Forms-Plugin „stellungnahme"`,
);
return json({ ok: true }, { status: 201 });
}
if (res.status === 429) {