Skip to content
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

Add email link to set password. See issue #1205. #1283

Closed
wants to merge 739 commits into from

Conversation

kiatng
Copy link
Contributor

@kiatng kiatng commented Oct 26, 2020

Description (*)

When a customer account is created in backed, the password should not be emailed in plaintext. This PR add a new email template, which is modifed from the welcome email, by adding a link to set password.

image

For existing account, the email template used is the same as the forgot-password email.

This PR does not change existing feature on emailing plaintext password from backend, but it'll show a warning:
image

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes Customer cannot see password in email when it is set in backend #1205

Manual testing scenarios (*)

There are 2 scenarios:

Creating New Customer

  1. In backend, create a new customer with an email address which you own.
  2. When you receive the email, click on the link to set the password.
  3. Login with the new password.

Existing Customer

  1. In backend customer page, go to the customer you created above.
  2. Click on Email Link to Set Password.
  3. When you receive the email, click on the link to reset the password.
  4. Login with the new password.

Questions or comments

The landing page of the link is customer/account/changeforgotten with page title RESET PASSWORD. See screenshot. Does it need to be changed?

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All automated tests passed successfully (all builds are green)

@github-actions github-actions bot added Component: Adminhtml Relates to Mage_Adminhtml Component: Customer Relates to Mage_Customer translations Relates to app/locale labels Oct 26, 2020
<p class="highlighted-text">
Use the following values when prompted to log in:<br/>
<strong>Email</strong>: {{var customer.email}}<br/>
<strong>Password</strong>: (the password you set)
Copy link
Contributor

@rjocoleman rjocoleman Feb 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this line redundant/confusing? (considering that the main call to action in this email is to click a link and set a password, therefor they don't have one already set?)

@@ -49,6 +49,7 @@ public function render(Varien_Data_Form_Element_Abstract $element)
if ($element->getNote()) {
$html .= '<p class="note"><span>' . $element->getNote() . '</span></p>';
}
$html .= '<p id="email-passowrd-warning" style="display:none;" class="note"><span>' . Mage::helper('customer')->__('Warning: email cotains password in plaintext will be sent.') . '</span></p>';
Copy link
Contributor

@rjocoleman rjocoleman Feb 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't true because a link is sent instead of a password? this email template sends (the password you set when creating your account) in place of the password.

IMO the automatic email for a manually set password should be removed (if the manual password set feature is retained).

Copy link
Contributor

@rjocoleman rjocoleman Feb 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's also a couple of typos: cotains and email-passowrd-warning

Warning: an email containing the plaintext password will be sent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO the automatic email for a manually set password should be removed (if the manual password set feature is retained).

Hmmm... but it's hard to know if a use case exists where it's necessary to send a plaintext password to customer.

Anyway, the objective of this PR is to provide the UI for the backend admin to email a link to set password, especially for customer accounts created in the backend. The automatic email is an existng feature that can be addressed separetely, I don't want to do too many things.

fballiano and others added 25 commits January 4, 2023 13:17
* Better exceptions for file upload

* PHPCS fixes

* PHPCS fixes
Instead of checking the results of preg_match by counting the length of
the string, simply check for the success value. This prevents PHP 8.1
deprecation warnings.
…e#1490)

* New event so more validation classes can be added on the fly

I ran into a situation where I needed more complex validation rules like min and max length for strings and min and max values for integers. Without this change, I cannot make it.

* Added missing cast to array

* resolve codestyle issue

* change arrays append to ArrayObject->append()

Co-authored-by: Daniel Fahlke <[email protected]>
@github-actions github-actions bot added Component: CatalogRule Relates to Mage_CatalogRule Component: CatalogIndex Relates to Mage_CatalogIndex Component: CatalogSearch Relates to Mage_CatalogSearch Component: Centinel Relates to Mage_Centinel Component: Checkout Relates to Mage_Checkout Component: Cm/RedisSession Relates to Cm_RedisSession Component: Cms Relates to Mage_Cms Component: ConfigurableSwatches Relates to Mage_ConfigurableSwatches Component: Contacts Relates to Mage_Contacts Component: Core Relates to Mage_Core Component: Cron Relates to Mage_Cron Component: CurrencySymbol Relates to Mage_CurrencySymbol Component: Dataflow Relates to Mage_Dataflow Component: Directory Relates to Mage_Directory ddev documentation environment htaccess Mage.php Relates to app/Mage.php php-cs-fixer phpcs phpstan PHPStorm phpunit labels May 14, 2023
@kiatng
Copy link
Contributor Author

kiatng commented May 14, 2023

I tried to rebase by following this guide: https://gist.github.com/scottyhq/299e4d36018a2f13acfb2528a1553002. But it doesn't seem to work. Is there a guide I can use to rebase?

@fballiano
Copy link
Contributor

I follow this guide from @colinmollenhour and it works perfectly: OpenMage/rfcs#10 (comment)

(I always use the "squash" part of the guide)

@addison74
Copy link
Contributor

I would close this PR and create a new one because the number of modified files appears to be +5000, being attached from other PRs. I can't test it because there are too many conflicts.

@kiatng
Copy link
Contributor Author

kiatng commented May 15, 2023

See PR #3262

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Admin Relates to Mage_Admin Component: Adminhtml Relates to Mage_Adminhtml Component: AdminNotification Relates to Mage_AdminNotification Component: Api PageRelates to Mage_Api Component: Api2 Relates to Mage_Api2 Component: Authorizenet Relates to Mage_Authorizenet Component: Backup Relates to Mage_Backup Component: Bundle Relates to Mage_Bundle Component: Captcha Relates to Mage_Captcha Component: Catalog Relates to Mage_Catalog Component: CatalogIndex Relates to Mage_CatalogIndex Component: CatalogInventory Relates to Mage_CatalogInventory Component: CatalogRule Relates to Mage_CatalogRule Component: CatalogSearch Relates to Mage_CatalogSearch Component: Centinel Relates to Mage_Centinel Component: Checkout Relates to Mage_Checkout Component: Cm/RedisSession Relates to Cm_RedisSession Component: Cms Relates to Mage_Cms Component: ConfigurableSwatches Relates to Mage_ConfigurableSwatches Component: Contacts Relates to Mage_Contacts Component: Core Relates to Mage_Core Component: Cron Relates to Mage_Cron Component: CurrencySymbol Relates to Mage_CurrencySymbol Component: Customer Relates to Mage_Customer Component: Dataflow Relates to Mage_Dataflow Component: Directory Relates to Mage_Directory ddev documentation environment htaccess Mage.php Relates to app/Mage.php php-cs-fixer phpcs phpstan PHPStorm phpunit translations Relates to app/locale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Customer cannot see password in email when it is set in backend