From 0b4d6d60521f100db3c5320cfcd6e62ba2f870e2 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 27 Sep 2021 15:10:06 +0100 Subject: [PATCH] SMTP config fallback logic --- packages/worker/src/utilities/email.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/worker/src/utilities/email.js b/packages/worker/src/utilities/email.js index cd29170348..5fd8c05939 100644 --- a/packages/worker/src/utilities/email.js +++ b/packages/worker/src/utilities/email.js @@ -114,10 +114,12 @@ async function getSmtpConfiguration(db, workspaceId = null) { const customConfig = getScopedConfig(db, params) - if (customConfig && !env.SMTP_FALLBACK_ENABLED) { + if (customConfig) { return customConfig - } else { - // Use an SMTP fallback configuration from env variables + } + + // Use an SMTP fallback configuration from env variables + if (env.SMTP_FALLBACK_ENABLED) { return { port: env.SMTP_PORT, host: env.SMTP_HOST,