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

@@ -73,6 +73,10 @@ services:
STRIPE_PRICE_ID_BUSINESS_YEARLY: ${STRIPE_PRICE_ID_BUSINESS_YEARLY:-}
# Email & Analytics
RESEND_API_KEY: ${RESEND_API_KEY:-}
SMTP_HOST: ${SMTP_HOST:-smtp.qrmaster.net}
SMTP_PORT: ${SMTP_PORT:-465}
SMTP_USER: ${SMTP_USER:-timo@qrmaster.net}
SMTP_PASS: ${SMTP_PASS:-}
NEXT_PUBLIC_POSTHOG_KEY: ${NEXT_PUBLIC_POSTHOG_KEY:-}
NEXT_PUBLIC_POSTHOG_HOST: ${NEXT_PUBLIC_POSTHOG_HOST:-https://us.i.posthog.com}
# Cloudflare R2 Storage

View File

@@ -539,13 +539,22 @@ export async function sendAIFeatureLaunchEmail(email: string) {
// ---------------------------------------------------------------------------
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: process.env.SMTP_HOST || 'smtp.qrmaster.net',
port: parseInt(process.env.SMTP_PORT || '465', 10),
secure: true, // port 465 = SSL
host,
port,
secure: port === 465,
auth: {
user: process.env.SMTP_USER || 'timo@qrmaster.net',
pass: process.env.SMTP_PASS,
user,
pass,
},
});
}