diff --git a/scripts/build/server.sh b/scripts/build/server.sh index 2ec83a3e1..b903f8250 100755 --- a/scripts/build/server.sh +++ b/scripts/build/server.sh @@ -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" diff --git a/server/lib/emailer.ts b/server/lib/emailer.ts index 935c9e882..04aade83a 100644 --- a/server/lib/emailer.ts +++ b/server/lib/emailer.ts @@ -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 })) } }