Answers.Body: <p>You can get the user by email</p>
  
  <pre><code>{% set user = craft.users.status(null).email("a@b.de").one() %}
  {{ user.id?? 'no user found' }}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-11T15:34:12.467Z
Answers.LastActivityDate: 2018-07-11T15:34:12.467Z
Answers.UserDisplayName: Robin Schambach
Body: <p>I would like to build a send activation email form on front-end, for users who didn't get or accidentaly delete the activation email.</p>
  
  <p>I can call the <code>users/send-activation-email</code> action to achieve this, but this action only accept a <code>userId</code> as parameter, not the <code>email</code> address.</p>
  
  <p>As I can't load unverified users from the front-end, it seems that I can't get the <code>id</code> of the current unverified user.</p>
  
  <p>I know I could write a plugin for this, but I was wondering if there's any way to achieve this without?</p>
  
  <p>Example of non-working send activation email form:</p>
  
  <pre><code>&lt;form method="post" accept-charset="UTF-8"&gt;
      {{ csrfInput() }}
      &lt;input type="hidden" name="action" value="users/send-activation-email"&gt;
      {{ redirectInput('') }}
      &lt;input type="email" name="email" required&gt;
      &lt;input type="submit" value="Submit"&gt;
  &lt;/form&gt;
  </code></pre>
  
Tags: <craft3><users><activation><frontend-form>
Title: How can I get the id of an unverified user on front-end?
ThreadText: # How can I get the id of an unverified user on front-end?
  
  (Asked by: username_0 on 2018-07-11)
  
  I would like to build a send activation email form on front-end, for users who didn't get or accidentaly delete the activation email.
  
  I can call the `users/send-activation-email` action to achieve this, but this action only accept a `userId` as parameter, not the `email` address.
  
  As I can't load unverified users from the front-end, it seems that I can't get the `id` of the current unverified user.
  
  I know I could write a plugin for this, but I was wondering if there's any way to achieve this without?
  
  Example of non-working send activation email form:
  
  ```
  <form method="post" accept-charset="UTF-8">
      {{ csrfInput() }}
      <input type="hidden" name="action" value="users/send-activation-email">
      {{ redirectInput('') }}
      <input type="email" name="email" required>
      <input type="submit" value="Submit">
  </form>
  
  ```
  
  **Tags:** craft3, users, activation, frontend-form
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-07-11. Score: 2 | Accepted answer
  
  You can get the user by email
  
  ```
  {% set user = craft.users.status(null).email("a@b.de").one() %}
  {{ user.id?? 'no user found' }}
  
  ```
  
  
  ---
  
  