concept
This commit is contained in:
59
docs/CONTACT_API.md
Normal file
59
docs/CONTACT_API.md
Normal file
@@ -0,0 +1,59 @@
|
||||
# Kontaktformular API (minimal)
|
||||
|
||||
## Endpoint
|
||||
|
||||
* Methode: POST
|
||||
* Pfad: /api/contact
|
||||
* Payload: JSON
|
||||
|
||||
Empfohlene Felder:
|
||||
|
||||
* name (string, required)
|
||||
* email (string, required)
|
||||
* company (string, optional)
|
||||
* message (string, required)
|
||||
* website (string, optional, Honeypot Feld, muss leer bleiben)
|
||||
|
||||
## Validierung
|
||||
|
||||
* name: min 2 Zeichen, max 100
|
||||
* email: simple RFC-validierung (pragmatisch)
|
||||
* message: min 20 Zeichen, max z.B. 4000
|
||||
* honeypot: muss leer sein
|
||||
|
||||
## Anti-Spam / Abuse
|
||||
|
||||
Minimal und wirksam:
|
||||
|
||||
* Rate Limit pro IP (z.B. 5 Requests pro 10 Minuten)
|
||||
* Logging nur technisch, keine Volltexte im Log (Datenschutz)
|
||||
* Generic Error Responses
|
||||
|
||||
Optional (V2): CAPTCHA nur, wenn Spam real auftritt.
|
||||
|
||||
## SMTP Versand
|
||||
|
||||
Nodemailer mit SMTP Settings.
|
||||
|
||||
Empfohlene Env Vars:
|
||||
|
||||
* SMTP_HOST
|
||||
* SMTP_PORT
|
||||
* SMTP_USER
|
||||
* SMTP_PASS
|
||||
* SMTP_FROM
|
||||
* CONTACT_RECIPIENT
|
||||
|
||||
E-Mail Inhalt:
|
||||
|
||||
* Subject: Kontaktanfrage von name
|
||||
* Reply-To: email
|
||||
* Body: Name, Firma, E-Mail, Nachricht, Zeitpunkt, IP anonymisiert (optional)
|
||||
|
||||
## Responses
|
||||
|
||||
* 200: Ok (immer gleiche Success Message)
|
||||
* 400: Validation Fehler (für UI nutzbar)
|
||||
* 429: Rate Limit
|
||||
* 500: SMTP/Server Fehler (generic)
|
||||
|
||||
Reference in New Issue
Block a user