prepare($sql); $stmt->execute([$_POST['email']]); $user = $stmt->fetch(); if ($user != null) { // account exists // create a password reset $password_reset_link = create_password_reset($user['id']); $safe_display_name = get_display_name($user['id'], use_bcid_fallback: true); try { $resend->emails->send([ 'from' => 'ByeCorps ID ', 'to' => [$safe_display_name . "<" . $user['email']. ">"], 'subject' => 'Reset your password', 'text' => 'Hey there '.$safe_display_name.'! Here is that password reset you requested. Just click the following link and you\'ll be sorted: '.$password_reset_link.' This link expires in 5 minutes. If you did not request this password reset, please ignore it (or tighten your account\'s security)']); // echo("This is a security issue."); } catch (Exception $e) { echo "Message could not be sent. Mailer Error: $e"; } } } ?>

Forgot password

".$message."

"; ?>

Forgot your password? We'll email you to reset it.