using array_walk_recursive instead of for each loop with email settings