You can use meta_query to specify what conditions you want to meet with that query you are performing. i.e.:
// grab some record from DB with a specific meta query
$args = array(
'post_type' => array( 'woo_commerce_something' ),
'orderby' => 'rand',
'posts_per_page' => -1,
'meta_query' => array(
array(
'key' => 'meta_something_woo_commerce_email',
'value' => 'email@[email protected]'
)
)
);
$the_query = new WP_Query( $args );
if ( $the_query->have_posts() ) :
while ( $the_query->have_posts() ) : $the_query->the_post();
// do something
endwhile;
endif;
wp_reset_postdata();