Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Daily email notification

Daily email notification

// Scheduled Action Hook
function send_mail( ) {
	return wp_mail( '[email protected]', 'Notification TEST', 'TEST', null );
}

// Schedule Cron Job Event
function custom_cron_job() {
	if ( ! wp_next_scheduled( 'send_mail' ) ) {
		wp_schedule_event( current_time( 'timestamp' ), 'daily', 'send_mail' );
	}
}
add_action( 'wp', 'custom_cron_job' );