Fix emails
authorChocobozzz <me@florianbigard.com>
Tue, 2 Jun 2020 07:21:33 +0000 (09:21 +0200)
committerChocobozzz <me@florianbigard.com>
Tue, 2 Jun 2020 07:21:33 +0000 (09:21 +0200)
scripts/build/server.sh
server/lib/emailer.ts

index 2ec83a3e1ade0d224febf287e09e4236caf1a8ad..b903f8250b3b410b1cbf4c1de27015f163a708e5 100755 (executable)
@@ -7,3 +7,4 @@ rm -rf ./dist
 npm run tsc
 cp "./tsconfig.json" "./dist"
 cp -r "./server/static" "./server/assets" "./dist/server"
+cp -r "./server/lib/emails" "./dist/server/lib"
index 935c9e882ca15f5715888d333a9e8cbff53a203a..04aade83a2a882dc480243cd0219facfe6838627 100644 (file)
@@ -473,7 +473,7 @@ class Emailer {
       },
       transport: this.transporter,
       views: {
-        root: join(root(), 'server', 'lib', 'emails')
+        root: join(root(), 'dist', 'server', 'lib', 'emails')
       },
       subjectPrefix: CONFIG.EMAIL.SUBJECT.PREFIX
     })
@@ -498,8 +498,8 @@ class Emailer {
           },
           options // overriden/new variables given for a specific template in the payload
         ) as SendEmailOptions)
-        .then(logger.info)
-        .catch(logger.error)
+        .then(res => logger.debug('Sent email.', { res }))
+        .catch(err => logger.error('Error in email sender.', { err }))
     }
   }