diff --git a/lib/mailer.ts b/lib/mailer.ts index 09acd77..f03013f 100644 --- a/lib/mailer.ts +++ b/lib/mailer.ts @@ -1,6 +1,15 @@ import nodemailer from "nodemailer"; import { queueEmail } from "./email-queue"; +function escapeHtml(value: string): string { + return value + .replace(/&/g, "&") + .replace(//g, ">") + .replace(/"/g, """) + .replace(/'/g, "'"); +} + // Port 587 = STARTTLS, Port 465 = SSL/TLS const transporter = nodemailer.createTransport({ host: process.env.SMTP_HOST, @@ -228,7 +237,7 @@ export async function sendeFlyerBenachrichtigung( Ein Interessent hat den MBO FamilyGuard Flyer angefordert.

- +
E-Mail${data.email}
E-Mail${escapeHtml(data.email)}