WELCOME TO YOUR JOURNEY

'Security check failed. Please refresh and try again.'], 403); } $raw = isset($_POST['payload']) ? wp_unslash($_POST['payload']) : ''; $data = json_decode($raw, true); if (!is_array($data)) { wp_send_json_error(['message' => 'Invalid submission format.'], 400); } $name = isset($data['name']) ? sanitize_text_field($data['name']) : ''; $email = isset($data['email']) ? sanitize_email($data['email']) : ''; $phone = isset($data['phone']) ? sanitize_text_field($data['phone']) : ''; $startDate = isset($data['startDate']) ? sanitize_text_field($data['startDate']) : ''; $coach = isset($data['coach']) ? sanitize_text_field($data['coach']) : 'Derick Gant'; $lines = []; $lines[] = "24K LIFE — BASELINE & ORIGIN SUBMISSION"; $lines[] = "--------------------------------------"; $lines[] = "Name: {$name}"; $lines[] = "Email: {$email}"; $lines[] = "Phone: {$phone}"; $lines[] = "Start Date: {$startDate}"; $lines[] = "Coach: {$coach}"; $lines[] = ""; $lines[] = "FULL PAYLOAD:"; foreach ($data as $k => $v) { if (is_array($v) || is_object($v)) $v = wp_json_encode($v); $k_clean = sanitize_text_field($k); $v_clean = is_string($v) ? sanitize_textarea_field($v) : sanitize_text_field((string)$v); $lines[] = "{$k_clean}: {$v_clean}"; } $body = implode("\n", $lines); $to = '[email protected]'; $subject = 'New 24K Life Baseline Submission' . ($name ? " — {$name}" : ''); $headers = []; if (!empty($email) && is_email($email)) { $headers[] = "Reply-To: {$name} <{$email}>"; } $sent = wp_mail($to, $subject, $body, $headers); if (!$sent) { wp_send_json_error(['message' => 'Email failed to send. Install WP Mail SMTP for reliable delivery.'], 500); } wp_send_json_success(['message' => 'Submitted successfully.']); } // Shortcode renders the entire form + JS add_shortcode('24k_baseline_report', function () { $nonce = wp_create_nonce('dg_24k_baseline_nonce'); $ajax_url = admin_url('admin-ajax.php'); $html = <<
24K LIFE • BASELINE & ORIGIN

Baseline & Origin Report

This is your Day Zero snapshot. We measure your transformation at 3/6/9/12 months.

1) Client Profile

2) Emotional & Identity Baseline (1–10)

3) Financial Snapshot

Income (Monthly)

Assets

Debts

4) Credit & Risk Profile

5) Notes

Actions

HTML; return $html; });