Refactor email enabled function

This commit is contained in:
Chocobozzz 2020-02-17 10:27:00 +01:00
parent 45f1bd72a0
commit 4c1c170934
No known key found for this signature in database
GPG key ID: 583A612D890159BE
11 changed files with 37 additions and 47 deletions

View file

@ -11,10 +11,9 @@ import { ClientHtml } from '../../lib/client-html'
import { auditLoggerFactory, CustomConfigAuditView, getAuditIdFromRes } from '../../helpers/audit-logger'
import { remove, writeJSON } from 'fs-extra'
import { getServerCommit } from '../../helpers/utils'
import { Emailer } from '../../lib/emailer'
import validator from 'validator'
import { objectConverter } from '../../helpers/core-utils'
import { CONFIG, reloadConfig } from '../../initializers/config'
import { CONFIG, isEmailEnabled, reloadConfig } from '../../initializers/config'
import { PluginManager } from '../../lib/plugins/plugin-manager'
import { getThemeOrDefault } from '../../lib/plugins/theme-utils'
import { Hooks } from '@server/lib/plugins/hooks'
@ -87,7 +86,7 @@ async function getConfig (req: express.Request, res: express.Response) {
default: defaultTheme
},
email: {
enabled: Emailer.isEnabled()
enabled: isEmailEnabled()
},
contactForm: {
enabled: CONFIG.CONTACT_FORM.ENABLED