feat: add logger
This commit is contained in:
parent
a4b9f46afd
commit
8525c1c1af
@ -1,10 +1,12 @@
|
|||||||
import { MailerService } from '@nestjs-modules/mailer'
|
import { MailerService } from '@nestjs-modules/mailer'
|
||||||
import { Injectable } from '@nestjs/common'
|
import { Injectable, Logger } from '@nestjs/common'
|
||||||
|
|
||||||
import { TemplateService } from './template.service'
|
import { TemplateService } from './template.service'
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class MailService {
|
export class MailService {
|
||||||
|
private readonly logger = new Logger(MailService.name)
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private readonly transporter: MailerService,
|
private readonly transporter: MailerService,
|
||||||
private readonly templateService: TemplateService
|
private readonly templateService: TemplateService
|
||||||
@ -18,6 +20,7 @@ export class MailService {
|
|||||||
subject: 'Ваш код подтверждения',
|
subject: 'Ваш код подтверждения',
|
||||||
html
|
html
|
||||||
})
|
})
|
||||||
|
this.logger.log(`Send OTP to ${email}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
public async sendEmailChange(email: string, code: string) {
|
public async sendEmailChange(email: string, code: string) {
|
||||||
@ -27,5 +30,6 @@ export class MailService {
|
|||||||
subject: 'Подтверждение смены почты',
|
subject: 'Подтверждение смены почты',
|
||||||
html
|
html
|
||||||
})
|
})
|
||||||
|
this.logger.log(`Send email change to ${email}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user