Update logging for smtp emails (#3536)

This commit is contained in:
martmull
2024-01-22 16:06:10 +01:00
committed by GitHub
parent f1b3d1537a
commit e45a825a3a
2 changed files with 12 additions and 4 deletions

View File

@ -1,4 +1,4 @@
import { Injectable, Logger } from '@nestjs/common';
import { Injectable } from '@nestjs/common';
import { SendMailOptions } from 'nodemailer';
@ -8,11 +8,9 @@ import { EmailSenderService } from 'src/integrations/email/email-sender.service'
@Injectable()
export class EmailSenderJob implements MessageQueueJob<SendMailOptions> {
private readonly logger = new Logger(EmailSenderJob.name);
constructor(private readonly emailSenderService: EmailSenderService) {}
async handle(data: SendMailOptions): Promise<void> {
await this.emailSenderService.send(data);
this.logger.log(`Email to ${data.to} sent`);
}
}