aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-02-17 10:27:00 +0100
committerChocobozzz <me@florianbigard.com>2020-02-17 10:27:00 +0100
commit4c1c17093461b58d3ee3f23f239e340d8dac1149 (patch)
tree236b724f1415a812a4274fd63b519124cba2e42f /server/lib
parent45f1bd72a08998c60a9dd68ff069cea9de39161c (diff)
downloadPeerTube-4c1c17093461b58d3ee3f23f239e340d8dac1149.tar.gz
PeerTube-4c1c17093461b58d3ee3f23f239e340d8dac1149.tar.zst
PeerTube-4c1c17093461b58d3ee3f23f239e340d8dac1149.zip
Refactor email enabled function
Diffstat (limited to 'server/lib')
-rw-r--r--server/lib/emailer.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/lib/emailer.ts b/server/lib/emailer.ts
index 0f74d2a8c..d0874ab20 100644
--- a/server/lib/emailer.ts
+++ b/server/lib/emailer.ts
@@ -1,7 +1,7 @@
1import { createTransport, Transporter } from 'nodemailer' 1import { createTransport, Transporter } from 'nodemailer'
2import { isTestInstance } from '../helpers/core-utils' 2import { isTestInstance } from '../helpers/core-utils'
3import { bunyanLogger, logger } from '../helpers/logger' 3import { bunyanLogger, logger } from '../helpers/logger'
4import { CONFIG } from '../initializers/config' 4import { CONFIG, isEmailEnabled } from '../initializers/config'
5import { JobQueue } from './job-queue' 5import { JobQueue } from './job-queue'
6import { EmailPayload } from './job-queue/handlers/email' 6import { EmailPayload } from './job-queue/handlers/email'
7import { readFileSync } from 'fs-extra' 7import { readFileSync } from 'fs-extra'
@@ -40,7 +40,7 @@ class Emailer {
40 if (this.initialized === true) return 40 if (this.initialized === true) return
41 this.initialized = true 41 this.initialized = true
42 42
43 if (Emailer.isEnabled()) { 43 if (isEmailEnabled) {
44 logger.info('Using %s:%s as SMTP server.', CONFIG.SMTP.HOSTNAME, CONFIG.SMTP.PORT) 44 logger.info('Using %s:%s as SMTP server.', CONFIG.SMTP.HOSTNAME, CONFIG.SMTP.PORT)
45 45
46 let tls 46 let tls
@@ -459,7 +459,7 @@ class Emailer {
459 } 459 }
460 460
461 async sendMail (options: EmailPayload) { 461 async sendMail (options: EmailPayload) {
462 if (!Emailer.isEnabled()) { 462 if (!isEmailEnabled()) {
463 throw new Error('Cannot send mail because SMTP is not configured.') 463 throw new Error('Cannot send mail because SMTP is not configured.')
464 } 464 }
465 465