feat(termine+matrix): Nutzer-Termin-Einreichung (Draft) + Matrix-Notifications
- /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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user