diff options
Diffstat (limited to 'server/lib/emailer.ts')
-rw-r--r-- | server/lib/emailer.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/server/lib/emailer.ts b/server/lib/emailer.ts index 9327792fb..074d4ad44 100644 --- a/server/lib/emailer.ts +++ b/server/lib/emailer.ts | |||
@@ -14,6 +14,7 @@ class Emailer { | |||
14 | private static instance: Emailer | 14 | private static instance: Emailer |
15 | private initialized = false | 15 | private initialized = false |
16 | private transporter: Transporter | 16 | private transporter: Transporter |
17 | private enabled = false | ||
17 | 18 | ||
18 | private constructor () {} | 19 | private constructor () {} |
19 | 20 | ||
@@ -50,6 +51,8 @@ class Emailer { | |||
50 | tls, | 51 | tls, |
51 | auth | 52 | auth |
52 | }) | 53 | }) |
54 | |||
55 | this.enabled = true | ||
53 | } else { | 56 | } else { |
54 | if (!isTestInstance()) { | 57 | if (!isTestInstance()) { |
55 | logger.error('Cannot use SMTP server because of lack of configuration. PeerTube will not be able to send mails!') | 58 | logger.error('Cannot use SMTP server because of lack of configuration. PeerTube will not be able to send mails!') |
@@ -57,6 +60,10 @@ class Emailer { | |||
57 | } | 60 | } |
58 | } | 61 | } |
59 | 62 | ||
63 | isEnabled () { | ||
64 | return this.enabled | ||
65 | } | ||
66 | |||
60 | async checkConnectionOrDie () { | 67 | async checkConnectionOrDie () { |
61 | if (!this.transporter) return | 68 | if (!this.transporter) return |
62 | 69 | ||