]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/emailer.ts
Use move instead rename
[github/Chocobozzz/PeerTube.git] / server / lib / emailer.ts
index 9327792fb6f8a731e10e252f2325218eff24dfdd..074d4ad44b8c50aebcba69cb3ff45062bc7f430f 100644 (file)
@@ -14,6 +14,7 @@ class Emailer {
   private static instance: Emailer
   private initialized = false
   private transporter: Transporter
+  private enabled = false
 
   private constructor () {}
 
@@ -50,6 +51,8 @@ class Emailer {
         tls,
         auth
       })
+
+      this.enabled = true
     } else {
       if (!isTestInstance()) {
         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 {
     }
   }
 
+  isEnabled () {
+    return this.enabled
+  }
+
   async checkConnectionOrDie () {
     if (!this.transporter) return