Skip to content

Fix newsletter verification and confirmation during account registration - #139

Open
Codencode wants to merge 1 commit into
PrestaShop:devfrom
Codencode:fix/17097-newsletter-emails-account-registration
Open

Fix newsletter verification and confirmation during account registration#139
Codencode wants to merge 1 commit into
PrestaShop:devfrom
Codencode:fix/17097-newsletter-emails-account-registration

Conversation

@Codencode

@Codencode Codencode commented Aug 29, 2026

Copy link
Copy Markdown
Member
Questions Answers
Description? Fixes PrestaShop/PrestaShop#17097 by handling newsletter verification and confirmation emails when a customer subscribes during account registration.
- Sends the verification email during account creation when NW_VERIFICATION_EMAIL is 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.
Type? bug fix
BC breaks? no
Deprecations? no
Fixed ticket? Fixes PrestaShop/PrestaShop#17097
How to test? 1. Enable NW_CONFIRMATION_EMAIL and disable NW_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_EMAIL and NW_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.

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.
@Codencode

Copy link
Copy Markdown
Member Author

@PrestaShop/committers ping for review

@Codencode
Codencode requested a review from Hlavtox September 7, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for review

Development

Successfully merging this pull request may close these issues.

Newsletter Verification Mail & Confirmation email when creating a new customer are not sent

2 participants