‘Missing fields’]);
}

// Generate Activation Link (Points back to current page with a query param)
// IMPORTANT: In a real system, you would store a unique token in the DB and use that for activation.
// For this example, we pass the data directly in the URL, which is less secure but functional.
$activation_link = add_query_arg([
‘sbl_activate’ => ‘true’,
‘rider_name’ => urlencode($name),
‘rider_phone’ => urlencode($phone),
‘rider_email’ => urlencode($email)
], $current_url);

// Booking Policies Link (Replace # with your actual URL if you have a specific page)
$policy_link = home_url(‘/booking-policies’);

// Email Subject & Body
$subject = “Action Required: Activate your Swiss Black Limo Account”;
$headers = array(‘Content-Type: text/html; charset=UTF-8’);

$message = ”


Welcome, $name!

Thank you for registering with Swiss Black Limo International.

Step 1: Please read our booking rules here:
Booking Policies – Swiss Black Limo International

Step 2: You must activate your account to book a ride:

Click Here to Activate Account

See you soon!



“;

// Send Mail
$sent = wp_mail($email, $subject, $message, $headers);

if ($sent) {
wp_send_json_success([‘message’ => ‘Email sent’]);
} else {
// In a production environment, you would log the failure and attempt a fallback.
wp_send_json_error([‘message’ => ‘Failed to send email. Check WP mail settings or logs.’]);
}
wp_die(); // Required for all WP AJAX handlers
}

/* * 2. FRONTEND: The Dispatch System UI (HTML/CSS)
*/
add_action(‘wp_footer’, function() {
?>

Swiss Black Limo
Dispatch

Welcome!

Please select your role:


Rider Access

Choose your access method:


Back to Role Selection

Driver Access

Existing drivers or new applicants:


Back to Role Selection

Rider Registration

Register to receive your Activation Link.




Back to Login/Register

Check Your Email

Activation Link Sent!

We have sent an email to .

Please click the link in that email to activate your account and view our Booking Policies.

Driver Application

Vehicle & Documents



Vehicle Details


Required Documents **(Must select files to submit)**



Back to Login/Application

Book a Ride

Welcome back, Rider

Est. Price: CHF 0.00
Payment Method


Card payment will soon be activated

Close




Views: 22