// signup.listener.ts
import { Injectable } from '@nestjs/common';
import { OnEvent } from '@nestjs/event-emitter';
import { guglu } from 'src/constants/email';
import { getConfig } from 'src/utils/siteconfig';
// import { MailService } from '../../mail/mail.service';
import { ResetPassEvent } from '../events/resetpass-event';

@Injectable()
export class ResetPassListener {
  // constructor(private emailsend: MailService) {}
  // @OnEvent('user.resetpass')
  // sendAdminEmail(userdetail: ResetPassEvent) {
  //   const site = userdetail.flag ? userdetail.flag : guglu.sitename;
  //   const config = getConfig(site);
  //   const to = userdetail.user?.email
  //     ? userdetail.user?.email
  //     : config.adminEmail;
  //   this.emailsend.sendEmail(
  //     config.replyTo,
  //     to,
  //     `Reset Password Instructions`,
  //     `${config.template_path}forgotpassword.hbs`,
  //     {
  //       passwordResetLink: `${config.resetlink}?token=${userdetail.token}`,
  //       subject: 'Reset Password Instructions',
  //       url: config.url,
  //     },
  //     `Hi ${userdetail.user?.name}. Your reset password link is ${config.resetlink}?token=${userdetail.token}`,
  //   );
  // }
}
