import { NextRequest, NextResponse } from 'next/server'; import nodemailer from 'nodemailer'; export async function POST(request: NextRequest) { try { const { username, term } = await request.json(); const transport = nodemailer.createTransport({ host: process.env.SMTP_HOST, port: parseInt(process.env.SMTP_PORT || '587'), secure: false, auth: { user: process.env.SMTP_USER, pass: process.env.SMTP_PASS }, }); await transport.sendMail({ from: `"${process.env.SMTP_FROM_NAME || 'AV Beat'}" <${process.env.SMTP_FROM_EMAIL}>`, to: 'editor@avbeat.com', subject: `[AV Beat] Blocked post attempt — banned term triggered`, html: `
A post submission was blocked by the banned terms system.
Details
User: ${username}
Triggered term: ${term}
The post was saved as a draft. The contributor was shown a generic error message with no indication of the ban.