From 728256d0a4d2f45ba7b805affc408c03228c8c4f Mon Sep 17 00:00:00 2001 From: Lakshay saini Date: Thu, 4 Jan 2024 00:23:53 +0530 Subject: [PATCH] bug: send email async --- apps/api/src/auth/service/auth.service.ts | 2 +- apps/api/src/mail/services/mail.service.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/api/src/auth/service/auth.service.ts b/apps/api/src/auth/service/auth.service.ts index ef6770a3..8d3d3d4f 100644 --- a/apps/api/src/auth/service/auth.service.ts +++ b/apps/api/src/auth/service/auth.service.ts @@ -56,7 +56,7 @@ export class AuthService { this.OTP_EXPIRY ) - await this.resend.sendOtp(email, otp.code) + this.resend.sendOtp(email, otp.code) this.logger.log(`Login code sent to ${email}: ${otp.code}`) } diff --git a/apps/api/src/mail/services/mail.service.ts b/apps/api/src/mail/services/mail.service.ts index 96aaf7c2..880e6a96 100644 --- a/apps/api/src/mail/services/mail.service.ts +++ b/apps/api/src/mail/services/mail.service.ts @@ -44,7 +44,7 @@ export class MailService implements IMailService { ` - await this.sendEmail(email, subject, body) + this.sendEmail(email, subject, body) } async projectInvitationMailForNonRegisteredUser( @@ -72,7 +72,7 @@ export class MailService implements IMailService { ` - await this.sendEmail(email, subject, body) + this.sendEmail(email, subject, body) } async sendOtp(email: string, otp: string): Promise { @@ -95,7 +95,7 @@ export class MailService implements IMailService { ` - await this.sendEmail(email, subject, body) + this.sendEmail(email, subject, body) } private async sendEmail( @@ -104,7 +104,7 @@ export class MailService implements IMailService { body: string ): Promise { try { - await this.transporter.sendMail({ + this.transporter.sendMail({ from: process.env.FROM_EMAIL, to: email, subject: subject,