-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Send set password link instead of the actual password to new users. #31257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and testing well! Left a minor stability comment
| 'sent_to_admin' => false, | ||
| 'plain_text' => false, | ||
| 'email' => $this, | ||
| 'set_password_url' => $this->set_password_url, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this guaranteed to be set before it's called? if not, then maybe we can create a getter method for set_password_url which will either generate the password URL if it does not exist yet, or return the generated URL if it already exist. wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point. I assumed it would be fine, because in the same place we use $this->user_login and $this->user_pass that are set in the same place (the trigger method in the same class).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think that's sufficient guarantee or shall we switch those to getters as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a public method, so we don't know when it could be called. That said, I'm approving because your explanation makes sense and should have been set in trigger class.
| 'sent_to_admin' => false, | ||
| 'plain_text' => true, | ||
| 'email' => $this, | ||
| 'set_password_url' => $this->set_password_url, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above, this could be null before it's called.
vedanshujain
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Leaving the merge to you based on if you want to take action on https://github.com/woocommerce/woocommerce/pull/31257/files#r754308635
Konamiman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me too, tested all the cases in the PR description and it works as expected.
|
Hi @peterfabian, thanks for merging this pull request. Please take a look at these follow-up tasks you may need to perform:
|
|
Hi team, I wanted to know that is this feature available to the users now? I updated my plugin to 6.0.0 but still the password is being sent to the users via email. |
|
Hi @avidews . I just tested a fresh installation with WC 6.0 and tried creating a new account via In both cases, the email I got didn't include the password. Which workflow are you using to create a user account? Does your website maybe use custom templates you need to adjust according to how it's been done for the default templates?
|
|
Hi @peterfabian. Thanks a lot for your reply. You just solved my problem, my website is using a plugin for custom email templates and the new account email template is still using {user_pass}. I think I need to contact the plugin team to update their plugin? Thanks lot for your help. |
|
Great to hear. Yes, exactly, please contact the plugin authors. |
|
Greetings all and @peterfabian @rodelgc @melek I think this is an improvement over sending plain text password, so good call! Two questions (and I am not sure if I need to open a new ticket for this)...
Is that the correct behaviour? Because it seems unnecessary to send it to a new user that has just registered.
Thanks |
The 'Password Changed' emails are part of WordPress. They can be disabled on your site with a filter, see this forum post for more details: I agree with you that suppressing these emails when a new customer initially sets their password is worth considering :) If you want that functionality, I recommend filing an issue so it can be discussed.
Different shop owners will have different preferences on checkout and account creation flow; I for instance think that asking the customer to go through an email process encourages extra engagement. In any case, opining on how store owners should have users set passwords is outside the scope of this change. I also don't see any reason to remove an option from the Accounts & Privacy area. |
|
Should have maybe bumped |
All Submissions:
Changes proposed in this Pull Request:
Closes #31035.
How to test the changes in this Pull Request:
Allow customers to create an account during checkoutand
Allow customers to create an account on the "My account" pagewhile letting WC generate username and password.Other information:
Changelog entry
FOR PR REVIEWER ONLY: