fix mail subject and compose
This commit is contained in:
parent
99ac673fa6
commit
9f04ebe8dc
@ -29,6 +29,7 @@ services:
|
||||
image: mailhog/mailhog
|
||||
ports:
|
||||
- "6001:8025"
|
||||
- "1025:1025"
|
||||
mongoexpress:
|
||||
image: mongo-express
|
||||
environment:
|
||||
|
||||
@ -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')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user