Add new page to unsubscribe from unwanted emails - #973
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
c96fbe0 to
947124f
Compare
2372b13 to
7fa52a3
Compare
7fa52a3 to
54d0b5d
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 54d0b5dcbb
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const query = new URLSearchParams({ code }); | ||
|
|
||
| try { | ||
| await ApiClient.post(`${this.BASE_PATH}/unsubscribe?${query.toString()}`); |
There was a problem hiding this comment.
Add the trailing slash to the unsubscribe POST
When a user confirms unsubscribe, this calls /api/email/unsubscribe?code=..., but the backend endpoint is registered as /api/email/unsubscribe/. Because this is a POST through fetch, the missing slash is not a safe redirect path (Django may redirect or reject before the view runs, and redirects can turn the request into a GET), so valid unsubscribe links will show the generic error instead of opting the email out. Please include the slash before the query string.
Useful? React with 👍 / 👎.
|
People arriving on this page will have deliberately clicked the unsubscribe link in their email. I think it's fair to assume they want to unsubscribe. Flipping it the other way around feels like an annoying dark pattern (which, yes, is often used, but doesn't provide a great UX). |




This adds a simple page for unsubscribing from email notifications. The link to this page will be embedded in the footer of the ResearchHub email template. It works in an unauthenticated context and posts to the corresponding backend API, submitting the
codeembedded in the unsubscribe URL.