Configuraion

This commit is contained in:
Timo Knuth
2026-04-03 00:19:18 +02:00
parent 7afd39c18c
commit 97a6cc11f7
2 changed files with 29 additions and 16 deletions

View File

@@ -538,17 +538,26 @@ export async function sendAIFeatureLaunchEmail(email: string) {
// SMTP Transport (nodemailer) — used for retention / welcome emails
// ---------------------------------------------------------------------------
function createSmtpTransport() {
return nodemailer.createTransport({
host: process.env.SMTP_HOST || 'smtp.qrmaster.net',
port: parseInt(process.env.SMTP_PORT || '465', 10),
secure: true, // port 465 = SSL
auth: {
user: process.env.SMTP_USER || 'timo@qrmaster.net',
pass: process.env.SMTP_PASS,
},
});
}
function createSmtpTransport() {
const host = process.env.SMTP_HOST || 'smtp.qrmaster.net';
const port = parseInt(process.env.SMTP_PORT || '465', 10);
const user = process.env.SMTP_USER || 'timo@qrmaster.net';
const pass = process.env.SMTP_PASS?.trim();
if (!pass) {
throw new Error('SMTP_PASS is missing. Configure SMTP credentials before sending welcome or retention emails.');
}
return nodemailer.createTransport({
host,
port,
secure: port === 465,
auth: {
user,
pass,
},
});
}
const appUrl = process.env.NEXT_PUBLIC_APP_URL || 'https://www.qrmaster.net';