feat(core): add toggle for newsletter in account settings#2789
Merged
feat(core): add toggle for newsletter in account settings#2789
Conversation
🦋 Changeset detectedLatest commit: 73458dd The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
b525ef5 to
d17b4fc
Compare
d17b4fc to
a556726
Compare
a556726 to
5149f72
Compare
5149f72 to
ba9cb17
Compare
ba9cb17 to
be149d6
Compare
be149d6 to
adb2bb3
Compare
adb2bb3 to
4986452
Compare
4986452 to
23832fa
Compare
23832fa to
535ade3
Compare
535ade3 to
cb61ae3
Compare
4ada4ae to
afdd3d1
Compare
afdd3d1 to
c34fa5f
Compare
This was referenced Dec 23, 2025
jamesqquick
pushed a commit
that referenced
this pull request
Feb 11, 2026
* feat(core): add toggle for newsletter in account settings * fix: typo in action * chore: update success string
chanceaclark
pushed a commit
that referenced
this pull request
Apr 27, 2026
* feat(core): add toggle for newsletter in account settings * fix: typo in action * chore: update success string
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.
What/Why?
Add newsletter subscription toggle to account settings page, allowing customers to manage their marketing preferences directly from their account.
What Changed
NewsletterSubscriptionFormcomponent with a toggle switch for subscribing/unsubscribing to newslettersupdateNewsletterSubscriptionserver action that handles both subscribe and unsubscribe operations via BigCommerce GraphQL APIAccountSettingsSectionto conditionally display the newsletter subscription form when enabledCustomerSettingsQueryto fetchisSubscribedToNewsletterstatus andshowNewsletterSignupstore settingAccount.Settings.NewsletterSubscriptionnamespaceTesting
Locally and added end to end tests.
Kapture.2025-12-22.at.12.02.52.mp4
Migration
To add the newsletter subscription toggle to your account settings page:
Step 1: Copy the server action
Copy the new server action file to your account settings directory:
Step 2: Update the GraphQL query
Update
core/app/[locale]/(default)/account/settings/page-data.tsxto include newsletter subscription fields:Also update the return statement to include
newsletterSettings:Step 3: Copy the NewsletterSubscriptionForm component
Copy the new form component:
Step 4: Update AccountSettingsSection
Update
core/vibes/soul/sections/account-settings/index.tsx:Step 5: Update the account settings page
Update
core/app/[locale]/(default)/account/settings/page.tsx:AccountSettingsSection:Step 6: Add translation keys
Add the following keys to your locale files (e.g.,
messages/en.json):{ "Account": { "Settings": { ... "NewsletterSubscription": { "title": "Marketing preferences", "label": "Opt-in to receive emails about new products and promotions.", "marketingPreferencesUpdated": "Marketing preferences have been updated successfully!", "somethingWentWrong": "Something went wrong. Please try again later." } } } }Step 7: Verify the feature
/account/settingsas a logged-in customerThe newsletter subscription form will only display if
newsletterSubscriptionEnabledistrue(controlled by theshowNewsletterSignupstore setting).