Answers.Body: <p>Solved - bizarre one this.
  Was using a third-party email service via SMTP and it was manipulating the URL somehow. Switching to use a direct SMTP connection with a specific email account has resolved. </p>
  
  <p>Go figure!</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-07-08T08:35:47.090Z
Answers.LastActivityDate: 2016-07-08T08:35:47.090Z
Answers.UserDisplayName: Cole Henley
Body: <p>I have a site where am registering users via the front-end.
  I want to use email address as username and also want people to define their password on registration.</p>
  
  <p>I have set the following in <code>general.php</code>:</p>
  
  <pre><code>'useEmailAsUsername' =&gt; true,
  'autoLoginAfterAccountActivation' =&gt; true,
  'activateAccountSuccessPath' =&gt; 'register/success',
  'verificationCodeDuration' =&gt; 'P1W'     
  </code></pre>
  
  <p>However, when a user registers via the front-end - or I resend the activation link via the Control Panel - they are directed to a page/URL eg <code>actions/users/verifyemail?code=XXXX&amp;id=XXXX</code> and get the following error message:</p>
  
  <pre><code>Oops!
  
  Invalid verification code. Please login or reset your password.
  </code></pre>
  
  <p>Can't figure out why the verification code is not working.
  Any suggestions?</p>
  
  <p>Cole</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-07-08T08:18:06.677Z
Comments.Text: Further to this - if I copy the activation link from the back-end I get a different URL: `actions/users/setpassword?code=XXX&id=XXX` rather than `actions/users/verifyemail?code=XXXX&id=XXXX`
Comments.UserDisplayName: Cole Henley
Tags: <users><registration><activation>
Title: Member activation query
ThreadText: # Member activation query
  
  (Asked by: username_0 on 2016-07-08)
  
  I have a site where am registering users via the front-end.
  I want to use email address as username and also want people to define their password on registration.
  
  I have set the following in `general.php`:
  
  ```
  'useEmailAsUsername' => true,
  'autoLoginAfterAccountActivation' => true,
  'activateAccountSuccessPath' => 'register/success',
  'verificationCodeDuration' => 'P1W'     
  
  ```
  
  However, when a user registers via the front-end - or I resend the activation link via the Control Panel - they are directed to a page/URL eg `actions/users/verifyemail?code=XXXX&id=XXXX` and get the following error message:
  
  ```
  Oops!
  
  Invalid verification code. Please login or reset your password.
  
  ```
  
  Can't figure out why the verification code is not working.
  Any suggestions?
  
  username_0
  
  **Tags:** users, registration, activation
  
  > **Comments:**
  > **username_0**: Further to this - if I copy the activation link from the back-end I get a different URL: `actions/users/setpassword?code=XXX&id=XXX` rather than `actions/users/verifyemail?code=XXXX&id=XXXX`  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2016-07-08. Score: 1
  
  Solved - bizarre one this.
  Was using a third-party email service via SMTP and it was manipulating the URL somehow. Switching to use a direct SMTP connection with a specific email account has resolved.
  
  Go figure!
  
  
  ---
  
  