Skip to content

Adding Email Unsubscribe Page#264

Closed
jacob6838 wants to merge 79 commits into
developfrom
iapi-email-unsubscription
Closed

Adding Email Unsubscribe Page#264
jacob6838 wants to merge 79 commits into
developfrom
iapi-email-unsubscription

Conversation

@jacob6838

@jacob6838 jacob6838 commented Jan 13, 2026

Copy link
Copy Markdown
Collaborator

PR Details

Description

Emails generated by the Intersection API include an unsubscribe url. This PR adds the "unauthenticated" webapp page /unsubscribe, which authenticates the user using a signed JWT token generated by the intersection API and embedded in the unsubscribe url. This same page now also replaces the previous notification user settings page.

  • Migrating email subscription management from the python API to the Intersection API
    • POST /users/subscriptions/email-subscriptions
    • GET /users/subscriptions/email-subscriptions
  • Creating new unsubscribe endpoints which use custom jwt authentication
    • POST /users/unsubscribe/email-subscriptions
    • GET /users/unsubscribe/email-subscriptions
  • required_role is a new field in the email_type object, denoting what user role is required to receive that type of notification
  • new webapp email setting/subscription management page using shared SubscriptionForm
  • new webapp unsubscribe page (no login required) using shared SubscriptionForm
image

How Has This Been Tested?

2026-04-21.13-21-11.mp4

This was tested using the following steps:

  1. Startup the cvmanager and make sure to include the "intersection" profile, which now includes smtp4dev
  2. Generate an email notification from the Intersection API. Without the contact-support endpoint added in 259, this is difficult. I have been grabbing the user's keycloak token from the webapp dev console network tab, and then making a Postman POST request to the IAPI /emails/send-intersection-notification-summary endpoint, with some fake notification data
  3. Navigate to smtp4dev (localhost:5000), and navigate to the unsubscribe link
  4. This should bring you to the notification management page. You should not be prompted to log into the cvmanager.
  5. Change your email notifications and hit save. Refresh the page to conform the changes took effect

Types of changes

  • Defect fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that cause existing functionality to change)

Checklist:

  • My changes require new environment variables:
    • I have updated the docker-compose, K8s YAML, and all dependent deployment configuration files.
  • My changes require updates to the documentation:
    • I have updated the documentation accordingly.
  • My changes require updates and/or additions to the unit tests:
    • I have modified/added tests to cover my changes.
  • All existing tests pass.

jacob6838 and others added 4 commits January 15, 2026 08:55
…/api/emails/generators/IntersectionNotificationSummaryEmailGenerator.java

Co-authored-by: Matt Cook <mattheworion.cook@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 51 out of 52 changed files in this pull request and generated 6 comments.

Comments suppressed due to low confidence (1)

webapp/src/Unsubscribe.test.tsx:16

  • Unsubscribe.test.tsx is rendering the MUI Unsubscribe icon instead of the app's /unsubscribe page component. This makes the snapshot meaningless for the feature and would miss regressions in the actual unsubscribe flow. Import and render the local Unsubscribe component from ./Unsubscribe (or the correct path) instead of @mui/icons-material.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread webapp/src/features/api/unsubscribeApiSlice.ts
Comment thread webapp/src/features/api/subscriptionManagementApiSlice.ts
Comment thread webapp/src/components/SubscriptionManagement.tsx
Comment thread webapp/src/Unsubscribe.tsx
@jacob6838 jacob6838 requested a review from Copilot April 21, 2026 22:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 51 out of 52 changed files in this pull request and generated 5 comments.

Comments suppressed due to low confidence (1)

webapp/src/Unsubscribe.test.tsx:16

  • The snapshot test is rendering MUI’s Unsubscribe icon (@mui/icons-material) instead of the app’s Unsubscribe page component (./Unsubscribe). This makes the snapshot meaningless and won’t catch regressions in the unsubscribe flow. Import and render the page component (and provide any required router params/query string in the test).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread resources/sql_scripts/update_scripts/email_type_required_role.sql
Comment thread webapp/src/components/SubscriptionManagement.tsx
Comment thread resources/sql_scripts/CVManager_SampleData.sql Outdated
@jacob6838

Copy link
Copy Markdown
Collaborator Author

I am wondering if it would be worth it to manage intersection subscriptions by organization, so a user who is an admin in one org and user in another could only subscribe to support requests in the first org?

@mcook42 mcook42 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I'm still working through this review. There is a lot of new code and some more complex logic to review, so I'll need to come back another time to finish the rest of my review. Here are my comments so far

Comment thread resources/sql_scripts/update_scripts/email_type_required_role.sql
Comment thread resources/sql_scripts/update_scripts/email_type_required_role.sql
Comment thread resources/sql_scripts/CVManager_CreateTables.sql
@jacob6838 jacob6838 requested a review from mcook42 May 5, 2026 21:03
@jacob6838

Copy link
Copy Markdown
Collaborator Author

Migrated to #322 and #323

@jacob6838 jacob6838 closed this May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants