add : forget password

This commit is contained in:
2026-02-02 16:12:17 +03:30
parent b3f9457c78
commit a46dfdea93
8 changed files with 167 additions and 33 deletions
+16 -1
View File
@@ -16,7 +16,7 @@ import { IBaseNotificationData } from "../../notifications/interfaces/ISendNotif
@Injectable()
export class EmailService {
private readonly logger = new Logger(EmailService.name);
constructor(private readonly mailerService: MailerService) {}
constructor(private readonly mailerService: MailerService) { }
async sendVerificationEmail(to: string, link: string, fullName: string): Promise<SentMessageInfo> {
try {
@@ -174,4 +174,19 @@ export class EmailService {
// throw new InternalServerErrorException("error in sending admin notification email");
}
}
async sendOtpEmail({ userEmail, otp }: { userEmail: string, otp: string }) {
try {
await this.mailerService.sendMail({
to: userEmail,
subject: EmailMessage.VERIFY_OTP,
template: "otp",
context: {
otp,
},
});
} catch (error) {
this.logger.error("error in sending otp email", error);
}
}
}