Home Email an admin 36 hours after a new user registers in WordPress
 Anyone here know or can give me a guidance on how to email a WordPress Admin 36 hours after a new user registers on their website? This is what I'm trying to accomplish: Find all users in the database Check if users have a specific role/roles Check if some of these users have registered for 36 hours already Use WP_cron to set these (I'll use every hour to be sure that I catch all these users) Here is the code that I'm doing so far, but I'm always getting lost whenever I want to get the users that has registered for 36 hours. /** * SEND A NOTIFICATION AFTER 36 HOURS */ function myprefix_custom_cron_schedule( $schedules ) {$schedules['every_hour'] = array( 'interval' => 3600, // Every hour 'display' => __( 'Every hour' ), ); return $schedules; } add_filter( 'cron_schedules', 'myprefix_custom_cron_schedule' ); //Schedule an action if it's not already scheduled if ( ! wp_next_scheduled( 'qd_cron_hook' ) ) { wp_schedule_event( time(), 'every_hour', 'qd_cron_hook' ); } ///Hook into that action that'll fire every hour add_action( 'qd_cron_hook', 'qd_cron_function' ); //create function, that runs on cron function qd_cron_function() {$args = array( 'role' => 'business-pending', 'fields' => array( 'ID', 'user_registered' ), ); $users = get_users($args ); foreach($users as$user){ $user_regDate =$user->user_registered; $dateNow = gmdate("Y-m-d H:i:s");  This is where I get lost. I'm assuming that I have to subtract the time now to the user_registered value and then make a condition to only display users that has registered in 36 hours. $emailto = get_option('admin_email'); $subject = 'Please activate this user';$message = 'This user has not been activated.'; wp_mail( $emailto,$subject, \$message ); }  Any help will be appreciated. Thank you very much!