diff --git a/artifacts/api-server/src/routes/contact.ts b/artifacts/api-server/src/routes/contact.ts index 8f50978..c662ef6 100644 --- a/artifacts/api-server/src/routes/contact.ts +++ b/artifacts/api-server/src/routes/contact.ts @@ -67,13 +67,19 @@ router.post("/contact", contactRateLimit, async (req, res) => { "", "vielen Dank für Ihre Nachricht! Ich habe Ihre Anfrage erhalten und melde mich in der Regel innerhalb von 1–2 Werktagen bei Ihnen.", "", + "Zur Erinnerung, hier ist Ihre Nachricht:", + "—", + ...(subject ? [`Betreff: ${subject}`, ""] : []), + message, + "—", + "", "Mit freundlichen Grüßen", "Joachim Hummel", "", "—", "jh@unixweb.de", ].join("\n"), - htmlContent: buildConfirmationEmail(name), + htmlContent: buildConfirmationEmail({ name, subject, message }), }); req.log.info({ to: email }, "Confirmation email sent to sender via Brevo"); @@ -255,8 +261,18 @@ function buildNotificationEmail({ `; } -function buildConfirmationEmail(name: string): string { +function buildConfirmationEmail({ + name, + subject, + message, +}: { + name: string; + subject?: string; + message: string; +}): string { const safeName = escapeHtml(name); + const safeSubject = subject ? escapeHtml(subject) : null; + const safeMessage = escapeHtml(message); const brandBlue = "#3f4ff4"; const textDark = "#0f172a"; const textMid = "#334155"; @@ -265,6 +281,7 @@ function buildConfirmationEmail(name: string): string { const borderColor = "#e2e8f0"; const bgPage = "#f1f5f9"; const bgCard = "#ffffff"; + const bgQuote = "#f8fafc"; return ` @@ -301,7 +318,24 @@ function buildConfirmationEmail(name: string): string {

Vielen Dank, ${safeName}!

Ihre Anfrage ist eingegangen.

Schön, dass Sie sich gemeldet haben. Ich habe Ihre Nachricht erhalten und werde mich in der Regel innerhalb von 1–2 Werktagen bei Ihnen melden.

-

Bis dahin können Sie gerne mein Portfolio besuchen oder mir direkt eine E-Mail schicken.

+

Bis dahin können Sie gerne mein Portfolio besuchen oder mir direkt eine E-Mail schicken.

+ + + + + + +
+ + + + +
+

Ihre Nachricht

+ ${safeSubject ? `

Betreff: ${safeSubject}

` : ""} +

${safeMessage}

+
+