prepare(" SELECT id, company_name, email, status, account_status FROM affiliates WHERE LOWER(email) = LOWER(?) "); $stmt->execute([$email]); $affiliate = $stmt->fetch(); // Always show success to prevent email enumeration if ($affiliate && $affiliate['status'] === 'active' && $affiliate['account_status'] !== 'suspended') { // Invalidate existing unused tokens $pdo->prepare(" UPDATE partner_password_resets SET used = 1 WHERE affiliate_id = ? AND used = 0 ")->execute([$affiliate['id']]); $token = generatePartnerToken(); $expires = date('Y-m-d H:i:s', strtotime('+2 hours')); $pdo->prepare(" INSERT INTO partner_password_resets (affiliate_id, email, token, expires_at) VALUES (?, ?, ?, ?) ")->execute([$affiliate['id'], $affiliate['email'], $token, $expires]); $resetLink = 'https://relevantreflex.com/partners/reset-password.php?token=' . $token; $name = htmlspecialchars($affiliate['company_name']); $emailBody = "
"; sendPartnerEmail($affiliate['email'], 'Reset Your Partner Portal Password — Relevant Reflex', $emailBody); logPartnerActivity('Password reset requested', ['affiliate_id' => $affiliate['id'], 'email' => $affiliate['email']]); } $success = true; } catch (Exception $e) { logPartnerActivity('Forgot password error', ['error' => $e->getMessage()]); $errors[] = 'An error occurred. Please try again.'; } } } ?>Partner Portal
If that email is registered, a password reset link has been sent. Please check your inbox (and spam folder).
The link expires in 2 hours.
Enter your registered partner email address and we'll send you a link to reset your password.