fix: Do not crash if no email config is provided in .env file.

This commit is contained in:
charlesgauthereau
2026-01-16 22:22:38 +01:00
parent e10350268d
commit 3f31e85c06
+5
View File
@@ -41,6 +41,11 @@ export const sendEmail = async (data: Payload) => {
throw new Error("SMTP system settings not found.");
}
if (!settings.smtpHost || !settings.smtpPort || !settings.smtpUser || !settings.smtpPassword || !settings.smtpFrom) {
console.warn("Incomplete SMTP settings. Email not sent.");
return;
}
const emailsArray = data.to.split(",")
.map(email => email.trim());