From c2d0615b52b004e2e70ec9643eec54f40527279e Mon Sep 17 00:00:00 2001 From: KJ Roelke Date: Thu, 20 Nov 2025 09:24:28 -0600 Subject: [PATCH] bug fixes --- changelog.md | 2 +- inc/theme/class-rest-router.php | 24 ++++++++++++++++-------- src/styles/base/_utilities.scss | 3 ++- style.css | 2 +- 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/changelog.md b/changelog.md index 1a97ce2..082a2f0 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,6 @@ # Changelog -## 2.0.0 - [November 1, 2025] +## 2.0.1 - [November 20, 2025] - New Theme! diff --git a/inc/theme/class-rest-router.php b/inc/theme/class-rest-router.php index bcf10e0..746a7aa 100644 --- a/inc/theme/class-rest-router.php +++ b/inc/theme/class-rest-router.php @@ -75,14 +75,15 @@ public function register_routes() { * @return WP_REST_Response The REST response. */ public function handle_interest_form( WP_REST_Request $request ): WP_REST_Response { - $first_name = $request->get_param( 'firstName' ); - $last_name = $request->get_param( 'lastName' ); - $email = $request->get_param( 'email' ); - $interest = $request->get_param( 'interest' ); - $data = array( - 'code' => 'success', - 'message' => 'Interest form submitted successfully!', - 'data' => array( + $first_name = $request->get_param( 'firstName' ); + $last_name = $request->get_param( 'lastName' ); + $email = $request->get_param( 'email' ); + $interest = $request->get_param( 'interest' ); + $client_success = wp_mail( $email, 'Interest Form Submission', "Hey {$first_name}, thanks for your interest in $interest! I'll be in touch soon." ); + $admin_success = wp_mail( 'hello@macrosbysara.com', 'Interest Form Submission', "{$first_name} {$last_name} ({$email}) is interested in {$interest}." ); + $success = $client_success && $admin_success; + $data = array( + 'data' => array( 'status' => 200, 'firstName' => $first_name, 'lastName' => $last_name, @@ -90,6 +91,13 @@ public function handle_interest_form( WP_REST_Request $request ): WP_REST_Respon 'interest' => $interest, ), ); + if ( ! $success ) { + $data['message'] = 'Failed to send email.'; + $data['code'] = 500; + } else { + $data['message'] = 'Interest form submitted successfully!'; + $data['code'] = 200; + } return rest_ensure_response( $data ); } diff --git a/src/styles/base/_utilities.scss b/src/styles/base/_utilities.scss index 46f43ee..90f2f25 100644 --- a/src/styles/base/_utilities.scss +++ b/src/styles/base/_utilities.scss @@ -5,10 +5,11 @@ } .linktree-link { + position: relative; + @include m.btn-interaction(var(--wp--preset--color--primary), white); a { - position: relative; width: 100%; display: inline-block; text-decoration: none; diff --git a/style.css b/style.css index e0f56ab..c491e66 100644 --- a/style.css +++ b/style.css @@ -4,7 +4,7 @@ Theme URI: https://github.com/macrosbysara/wordpress-theme Author: KJ Roelke Author URI: https://kjroelke.online Description: A WordPress Theme built for Macros By Sara site -Version: 2.0.0 +Version: 2.0.1 Requires at least: 6.7.0 Tested up to: 6.8.3 Requires PHP: 8.2