I have a function that I’ve been attempting to get to work with wp\_schedule\_event. The function sends a notification to the admin. I see the event get added to the wp cron event list, but it never runs the function.
Function as follows:
“`php
<?php
function send_booking_expiration_notification(){
// do woocomerce booking stuff… then send email.
wp_mail($to, $subject, $message, $headers);
}
// Schedule the send_booking_expiration_notification() function to run daily at midnight
if ( ! wp_next_scheduled( ‘send_booking_expiration_hook’ ) ) {
wp_schedule_event( strtotime( ’12pm’ ), ‘hourly’, ‘send_booking_expiration_hook’ );
}
add_action( ‘send_booking_expiration_hook’, ‘send_booking_expiration_notification’ );
?>
“`
Am I misunderstanding scope or hooks. I’ve added the add_action above the function and still no dice. I can call the function and the have confirmed the function works and send email, but something with the cron isn’t working.

In your wp_schedule_event(), you have strtotime( ’12pm’ ). This converts the string ’12pm’ to a Unix timestamp, but I think it might always be in the past?
Try something like strtotime( ‘tomorrow 12pm’ ) / strtotime( ‘midnight’ ). I’m not sure if this is the problem, but it seems to be something with the scheduled event.
Are you using default cron config or have you modified anything? Start by running `wp cron test` and see what it reports.
If that looks good try running `wp cron event run send_booking_expiration_hook`. Do you get the expected notification?