Automattic / newspack-plugin

An advanced open-source publishing and revenue-generating platform for news organizations.
https://newspack.com
GNU General Public License v2.0
325 stars 49 forks source link

fix(ras-acc): add config flag to skip newsletters signup modal #3404

Closed chickenn00dle closed 3 weeks ago

chickenn00dle commented 3 weeks ago

All Submissions:

Changes proposed in this Pull Request:

Closes https://app.asana.com/0/inbox/1206274567818680/1208232700780031/1208232700780049/f

This PR addresses an issue where if checkout data is present in local storage, the auth flow will always skip the newsletters signup step. We fix this by adding an explicit skipNewslettersSignup flag to the auth modal config object and using this to decide whether to bypass the newsletters modal instead.

How to test the changes in this Pull Request:

  1. As admin, ensure the Present newsletter signup after checkout and registration setting is enabled and newsletter lists are selected via Newspack > Engagement > Show Advanced Settings
  2. As a logged out reader, visit any page with a donate or checkout button
  3. Trigger the auth + checkout flow by clicking the button
  4. Do not submit the form. Instead close it via the close button at the top right of the modal
  5. Click the Sign in button in the site header to trigger just the auth flow
  6. Select the Create an account button in the auth modal and register a new account
  7. Confirm the newsletter signup modal appears as the final step of the auth flow

Bonus:

Other information: