Configuraion
This commit is contained in:
@@ -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';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user