From a24a06002081ad71a78ffeff9072725ba39cf121 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Tue, 17 Feb 2026 20:05:31 +0000
Subject: [PATCH] =minor changes, particularly around the JVB_CHILD_URL pattern

---
 inc/rest/routes/LoginRoutes.php |   22 +---------------------
 1 files changed, 1 insertions(+), 21 deletions(-)

diff --git a/inc/rest/routes/LoginRoutes.php b/inc/rest/routes/LoginRoutes.php
index dc8d528..8ab30ce 100644
--- a/inc/rest/routes/LoginRoutes.php
+++ b/inc/rest/routes/LoginRoutes.php
@@ -340,7 +340,7 @@
 					'error' => $key->get_error_message(),
 				]);
 			} else {
-				$this->sendPasswordResetEmail($user, $key);
+				$success = JVB()->email()->sendPasswordResetEmail($user, $key);
 			}
 		}
 
@@ -710,26 +710,6 @@
 		}
 	}
 
-	/**
-	 * Send password reset email (fallback if magic links not available)
-	 */
-	protected function sendPasswordResetEmail(WP_User $user, string $key): bool
-	{
-		$reset_url = network_site_url(
-			"wp-login.php?action=rp&key=$key&login=" . rawurlencode($user->user_login),
-			'login'
-		);
-
-		$subject = 'Password Reset Request';
-		$message = sprintf(
-			"Hello %s,\n\nYou requested a password reset. Click the link below to reset your password:\n\n%s\n\nIf you didn't request this, please ignore this email.",
-			$user->display_name,
-			$reset_url
-		);
-
-		return wp_mail($user->user_email, $subject, $message);
-	}
-
 	protected function buildAuth(?int $user = null): array
 	{
 		if (is_user_logged_in()) {

--
Gitblit v1.10.0