Fix newsletter verification and confirmation during account registration - #139
Open
Codencode wants to merge 1 commit into
Open
Conversation
Handle newsletter verification and confirmation emails when a customer subscribes during account registration. * Reuse the existing subscription confirmation flow for voucher and confirmation emails. * Handle `NW_VERIFICATION_EMAIL` during account creation and keep the customer unsubscribed until verification is completed. * Preserve already verified guest subscriptions without requesting a second verification. * Remove the guest subscription record when it is transferred to the customer account. * Clarify in the module configuration that verification and confirmation email settings also apply during account registration.
Member
Author
|
@PrestaShop/committers ping for review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
- Sends the verification email during account creation when
NW_VERIFICATION_EMAILis enabled, keeping the customer unsubscribed until the verification link is confirmed.- Sends the confirmation email and voucher when verification is not required, reusing the existing
confirmSubscription()flow.- Preserves already active guest subscriptions without requesting a second verification and removes the guest record once the subscription is handled by the customer account.
- Refactors the subscription logic by introducing dedicated helper methods to retrieve the guest subscription status and manage the customer's pending newsletter state.
- - Clarifies the module configuration descriptions to indicate that verification and confirmation email settings also apply during account registration.
- Preserves the behavior introduced by #121 for customers creating an account without opting in to the newsletter.
NW_CONFIRMATION_EMAILand disableNW_VERIFICATION_EMAIL, then create a new customer account with the newsletter option checked. Verify that the customer is subscribed and receives the confirmation email.2. Enable both
NW_VERIFICATION_EMAILandNW_CONFIRMATION_EMAIL, then create a new customer account with the newsletter option checked. Verify that the customer is not subscribed before verification, receives the verification email, and becomes subscribed only after clicking the verification link. Verify that the confirmation email is sent after verification. Repeat the same scenario by creating the customer account during checkout and verify the same behavior.3. Subscribe an email through the newsletter form, complete the verification so the guest subscription is active, then create an account with the same email and the newsletter option checked. Verify that no second verification email is sent, the customer remains subscribed, and the duplicate guest subscription is removed.
4. Subscribe an email through the newsletter form, then create an account with the same email without checking the newsletter option. Verify that the existing guest subscription is preserved.
5. Configure a valid welcome voucher code and enable
NW_VERIFICATION_EMAIL, then create a new customer account with the newsletter option checked. Verify that the voucher email is not sent before verification and is sent only after clicking the verification link.