Initial SeConectai briefing system

This commit is contained in:
2026-10-04 10:42:23 -03:00
commit 45cd8d2f03
163 changed files with 12659 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
import nodemailer from "nodemailer";
type MailOptions = {
to: string;
subject: string;
text: string;
};
export async function sendMail({ to, subject, text }: MailOptions) {
const host = process.env.SMTP_HOST;
const port = Number(process.env.SMTP_PORT ?? 587);
const user = process.env.SMTP_USER;
const pass = process.env.SMTP_PASS;
const from = process.env.SMTP_FROM;
if (!host || !from) {
return;
}
const transporter = nodemailer.createTransport({
host,
port,
secure: port === 465,
auth: user && pass ? { user, pass } : undefined
});
await transporter.sendMail({
to,
from,
subject,
text
});
}