Skip to content

Commit

Permalink
fix: mail template path issue during production build fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
gobeam committed Jan 20, 2022
1 parent c77ef7e commit cff3fbc
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 5 deletions.
50 changes: 48 additions & 2 deletions config/development.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,56 @@
server:
port: 7777
origin: 'http://localhost:3000'

db:
host: 'localhost'
type: 'postgres'
port: 5432
database: 'truthy'
username: 'postgres'
password: 'root'
password: ''
synchronize: false

jwt:
secret: 'example@123'
expiresIn: 900
refreshExpiresIn: 604800
cookieExpiresIn: 604800
secret: 'Rtya$#asdf@sdfsco123ejsd@@3#'

app:
name: 'Truthy'
version: '0.2.0'
description: 'Official Truthy API'
appUrl: 'http://157.245.148.131:7777'
frontendUrl: 'http://157.245.148.131:3000'
sameSite: true

mail:
host: 'in-v3.mailjet.com'
port: 587
user: 'e3818ebeda5d271f541c4925e12e60af'
pass: 'fd10758be28c2873ddf9e359644e873a'
from: '[email protected]'
fromMail: '[email protected]'
preview: false
secure: false
ignoreTLS: true
queueName: 'truthy-mail'

queue:
driver: 'redis'
host: 'localhost'
port: 6379
db: ''
password: ''
username: ''

throttle:
global:
ttl: 60
limit: 60
login:
prefix: 'login_fail_throttle'
limit: 5
duration: 2592000
blockDuration: 3000
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "truthy-api",
"version": "0.2.0",
"version": "0.3.0",
"description": "Truthy API",
"author": "gobeam <[email protected]>",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion src/mail/mail.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const queueConfig = config.get('queue');
},
preview: mailConfig.preview,
template: {
dir: __dirname + '/templates',
dir: __dirname + '/templates/email/layouts/',
adapter: new PugAdapter(),
options: {
strict: true
Expand Down
2 changes: 1 addition & 1 deletion src/mail/mail.processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class MailProcessor {
to: job.data.payload.to,
from: process.env.MAIL_FROM || mailConfig.fromMail,
subject: job.data.payload.subject,
template: __dirname + `/../mail/templates/email/layouts/email-layout`,
template: 'email-layout',
context: job.data.payload.context,
attachments: job.data.payload.attachments
};
Expand Down

0 comments on commit cff3fbc

Please sign in to comment.