âMissing fields.â]);
}
// Activation Link (NOTE: demo approach; in production use a stored token)
$activation_link = add_query_arg(
[
âsbl_activateâ => âtrueâ,
ârider_nameâ => $name,
ârider_phoneâ => $phone,
ârider_emailâ => $email,
],
$current_url
);
$policy_link = home_url(â/booking-policiesâ);
$subject = âAction Required: Activate your Swiss Black Limo Accountâ;
$headers = [âContent-Type: text/html; charset=UTF-8â];
$name_esc = esc_html($name);
$policy_link_esc = esc_url($policy_link);
$activation_link_esc = esc_url($activation_link);
$message = â
Welcome, {$name_esc}!
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:
See you soon!
â;
$sent = wp_mail($email, $subject, $message, $headers);
if ($sent) {
wp_send_json_success([âmessageâ => âEmail sentâ]);
} else {
wp_send_json_error([âmessageâ => âFailed to send email. Check WP mail settings/logs.â]);
}
wp_die();
}
/**
* 2) FRONTEND: UI injected in footer
*/
add_action(âwp_footerâ, function () {
$ajax_url = admin_url(âadmin-ajax.phpâ);
$nonce = wp_create_nonce(âsbl_nonceâ);
// â
Put your real Google Maps API key here
$google_maps_key = âAIzaSyAPJpb4jbbnovmAJQIUhO0jgEnCrWtIPPEâ;
?>
