From 4c1c17093461b58d3ee3f23f239e340d8dac1149 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 17 Feb 2020 10:27:00 +0100 Subject: Refactor email enabled function --- server/initializers/config.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'server/initializers/config.ts') diff --git a/server/initializers/config.ts b/server/initializers/config.ts index 75372fa4e..950ca61bd 100644 --- a/server/initializers/config.ts +++ b/server/initializers/config.ts @@ -284,11 +284,16 @@ function registerConfigChangedHandler (fun: Function) { configChangedHandlers.push(fun) } +function isEmailEnabled () { + return !!CONFIG.SMTP.HOSTNAME && !!CONFIG.SMTP.PORT +} + // --------------------------------------------------------------------------- export { CONFIG, - registerConfigChangedHandler + registerConfigChangedHandler, + isEmailEnabled } // --------------------------------------------------------------------------- -- cgit v1.2.3