rules - check if email is in use I would like to create user account using rules, after anonymous user creates a node and inputs his email to a email field. Before that I need to run a condition if the email is already in use. 
What would be the easiest way of doing this? Using fetch entity by email or using custom php?
I read about user_authenticate function but I do not know how to use it. 
Thank you for advice.
$check=db_select('users','u')
    -&gt;fields('u',array('uid'))
    -&gt;condition('mail','user email comes here','=')
    -&gt;execute()
    -&gt;fetchField();

if($check!='')
{
    form_set_error('mail','Email Already Exists');
}


You can use this.