I am trying to get custom meta data from all users. I have the following code the returns no errors. So I don't know what is going wrong. Is there a more simple way to loop over all id's and return custom meta data?
global $wpdb;
$wp_user_search = $wpdb->get_results("SELECT ID FROM $wpdb->users ORDER BY ID");
foreach ($wp_user_search as $userid) {
$all_meta_for_user = get_user_meta($userid->id);
$email_alert = $all_meta_for_user['email_sms'][0];
echo $email_alert;
}