<p>Something like this should work:</p>

<pre><code>$user = User::find()
    -&gt;email($email)
    -&gt;status(null)
    -&gt;one();
</code></pre>

CC BY-SA 3.0
2016-12-22T18:15:01.537Z
2016-12-22T18:15:01.537Z
Brad Bell
<p>So I'm running into an issue where I'm given the users email. From there, I use the following code: <code>Craft::$app-&gt;getUsers()-&gt;getUserByEmail($email);</code>. This returns a null value, not because the user does not exists, but rather the status is set to suspended. </p>

<p>Is there a way to retrieve the <code>User</code> model from the email address, regardless of status? </p>

<users><craft3>
Obtain suspended users in Craft3 Dev Preview
# Obtain suspended users in Craft3 Dev Preview

(Asked by: username_0 on 2016-12-22)

So I'm running into an issue where I'm given the users email. From there, I use the following code: `Craft::$app->getUsers()->getUserByEmail($email);`. This returns a null value, not because the user does not exists, but rather the status is set to suspended.

Is there a way to retrieve the `User` model from the email address, regardless of status?

**Tags:** users, craft3


---

## 1 answers

### Answer by username_1 on 2016-12-22. Score: 2 | Accepted answer

Something like this should work:
$user = User::find()
    ->email($email)
    ->status(null)
    ->one();


---

