add : forget password
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user