fix mail subject and compose

This commit is contained in:
Michael Schramm 2020-06-01 01:09:11 +02:00
parent 99ac673fa6
commit 9f04ebe8dc
2 changed files with 2 additions and 1 deletions

View File

@ -29,6 +29,7 @@ services:
image: mailhog/mailhog
ports:
- "6001:8025"
- "1025:1025"
mongoexpress:
image: mongo-express
environment:

View File

@ -37,7 +37,7 @@ export class MailService {
const text = htmlToText.fromString(html)
const subject = /<title>(.*?)<\/title>/gi.test(html) ? html.match(/<title>(.*?)<\/title>/gi)[1] : template
const subject = /<title>(.*?)<\/title>/gi.test(html) ? /<title>(.*?)<\/title>/gi.exec(html)[1] : template
await this.nestMailer.sendMail({ to, subject, html, text })
this.logger.info('sent email')