import { MailService } from "./mailService"; function generateTempCode(): number { /** * Returns a temporary six-digit code. * * @retruns temporary six-digit code */ const minTemp:number = 111111; const maxTemp:number = 999999; return Math.floor(Math.random() * (maxTemp - minTemp + 1) + minTemp) } function sendTempCodeEmail(name: string, recipient: string, tempCode: number) { /** * Creates an email with a temporary code to a user. * * @param name - name of the user * @param recipient - email of the user * @param tempCode - a temporary code that was generated */ let message: string = ` Hello ${name},\n\n Access code: ${tempCode}\n This verification email is to make sure it's really you!\n\n Return to your login page and enter in your access code to finish your login. If you did not try to log in, please update your password ` let html: string = `
Hello ${name},
Access code: ${tempCode}
This verification email is to make sure it's really you!
Return to your login page and enter in your access code to finish your login.
If you did not try to log in, please update your password.