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

Preferences #590

Merged
merged 8 commits into from
Jan 26, 2024
Merged

Preferences #590

merged 8 commits into from
Jan 26, 2024

Conversation

DeeTheDev
Copy link
Collaborator

@DeeTheDev DeeTheDev commented Jan 22, 2024

Fixes #579

  • Add backend ability for members to change messaging preferences, when authenticated or with an auth access token.
    • When authenticated, store preferences in the use, then expose options to frontend
    • When unauthenticated, member must have an access token in the URL params to make an API call for preferences subscriptions, API returns masked user fields along with preferences, then expose options to frontend
  • Test

Frontend:

  • Add Preferences component to be used with routes:
    • /preferences for authenticated members
    • /preferences-public for members that have been provided an access token (to allow preference changes)
  • Localize all language

Admin:

  • Add messaging preferences fields to MemberDetailsPage"

Webapp top navigation "preferences" tab

Screenshot 2024-01-22 at 3 20 41 PM

Preferences page

Screenshot 2024-01-22 at 3 20 58 PM

Preferences saved message (when member authenticated)

Screenshot 2024-01-22 at 3 21 07 PM

Preferences saved message (when member NOT authenticated)

Screenshot 2024-01-22 at 3 21 54 PM

Admin Messaging Preferences section

Screenshot 2024-01-26 at 11 49 11 AM

@DeeTheDev DeeTheDev added backend Involves changes to the backend API admin Admin site changes webapp Public frontend changes labels Jan 22, 2024
@DeeTheDev DeeTheDev requested a review from rgalanakis January 22, 2024 20:42
@@ -188,5 +188,7 @@ class DetailedMemberEntity < MemberEntity
expose :sessions, with: MemberSessionEntity
expose :orders, with: MemberOrderEntity
expose :message_deliveries, with: MessageDeliveryEntity
expose :preferences, with: MessagePreferenceSubscriptionEntity,
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is ideal (should be like {preferences: {subscriptions: []}} but it's admin so easy to change later.

Copy link
Member

@rgalanakis rgalanakis left a comment

Choose a reason for hiding this comment

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

@DeeTheDev as I mentioned elsewhere, we need to expose the 'public url' in admin (the one to /preferences-public with the auth token). This is important because it's what CS will give out if someone wants to unsubscribe.

adminapp/src/pages/MemberDetailPage.jsx Outdated Show resolved Hide resolved
lib/suma/admin_api/members.rb Outdated Show resolved Hide resolved
lib/suma/admin_api/members.rb Outdated Show resolved Hide resolved
@DeeTheDev DeeTheDev requested a review from rgalanakis January 26, 2024 16:48
@rgalanakis rgalanakis merged commit aff36c6 into main Jan 26, 2024
3 checks passed
@rgalanakis rgalanakis deleted the preferences branch January 26, 2024 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
admin Admin site changes backend Involves changes to the backend API webapp Public frontend changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add subscription preferences page and support
2 participants