Surface audit generations on dashboard audits

This commit is contained in:
2026-06-06 18:14:27 +02:00
parent 3efbc06e40
commit e9463e8ef2
20 changed files with 3181 additions and 38 deletions

View File

@@ -0,0 +1,44 @@
"use node";
/**
* convex/outreachNode.ts
*
* SMTP-Versand. Eigene Datei mit "use node", weil nodemailer (TCP) im
* Standard-Isolate nicht läuft. Dateien mit "use node" dürfen NUR Actions
* enthalten — Queries/Mutations bleiben in outreach.ts.
*
* Voraussetzung: `nodemailer` in package.json.
*/
import { v } from "convex/values";
import { internalAction } from "./_generated/server";
import nodemailer from "nodemailer";
export const sendViaSmtp = internalAction({
args: {
host: v.string(),
port: v.number(),
secure: v.boolean(),
username: v.string(),
password: v.string(), // bereits entschlüsselt vom Orchestrator übergeben
fromName: v.string(),
fromAddress: v.string(),
to: v.string(),
subject: v.string(),
html: v.string(),
text: v.string(),
},
handler: async (_ctx, a) => {
const transport = nodemailer.createTransport({
host: a.host,
port: a.port,
secure: a.secure,
auth: { user: a.username, pass: a.password },
});
await transport.sendMail({
from: `"${a.fromName}" <${a.fromAddress}>`,
to: a.to,
subject: a.subject,
text: a.text,
html: a.html,
});
},
});