Repository navigation
feat: unsubscribe link - #1004
Conversation
👇 Click on the image for a new way to code review
Legend |
|
@gikf I wanted to be sure you've seen the earlier conversations about unsubscribe links and the chat about the difference between unfollowing / unsubscribing from a Chapter vs an event. Also, there was some discussion on using unsigned JWOT tokens. I think @ojeytonwilliams made that suggestion. |
|
There are also some draft examples of how the unsubscribe / unfollow link might appear in the email body or footer. |
|
@allella thanks for these. I haven't got yet in mind specifics what means unsubscribing from chapter, this will surely help with that. |
|
This is still messy and bit raw, but things are working. Some more general comments would be appreciated. The easiest way to get links is rsvping to the event and checking email with confirmation. |
|
@gikf it seems this is code, but let me know if there's any less technical questions where I can help. Thanks |
|
@allella Does trying out functionality matches that? 🙂 Some insights on how currently the whole process works also would be useful. |
|
Error in https://github.com/freeCodeCamp/chapter/runs/7315660461?check_suite_focus=true is a bit funny. I think it occurs, because |
|
@gikf Cypress worked fine locally, so I restarted CI. 🤞 |
|
I was able to get it locally as well. Once every few runs. Specifically with chromium. |
|
Okay, I'll see if I can reproduce it. |
|
@gikf I think your diagnosis was correct - sometimes By clearing before checking that should never happen. |
|
Huh, that solution is a bit weird 😃, thanks for it nevertheless. |
Co-authored-by: Oliver Eyton-Williams <[email protected]>
| export enum unsubscribeType { | ||
| Chapter, | ||
| Event, | ||
| } |
There was a problem hiding this comment.
Now it crossed my mind whether shouldn't there be added values to these enums, to ensure they stay consistent in future (ie. in case of adding instance unsubscribing, or just in general).
There was a problem hiding this comment.
They should have specific values, yeah, since their values lose their associated types when they're packaged up into tokens. And, well, it's less of a headache if token has a consistent structure and values, even if we knew how they were changing.
Also, nitpick: enums are conventionally PascalCase.
|
@ojeytonwilliams I'm assuming the new unsubscribe link doesn't require logging in, which still would allow someone else to unsubscribe if the person happened to forward the event email. Even if for post-MVP, do we want to send a confirmation email "You've been unsubscribed. We this a mistake, if so you can undo this action?" and/or would we want to put a warning note on the top or bottom of emails that use any sort of token to warn people of the risks of sharing? |
Co-authored-by: Oliver Eyton-Williams <[email protected]>
…feat/unsubscribe-link
I'm not sure we do, honestly. If someone doesn't want email, then sending them a confirmation email is probably not the way to go. We could show them a resubscribe page with that same info, though.
The only token we should be sending via email is this one due to the risk that someone accidentally shares it. As for whether or not we should warn people, I'm not sure. If we want to mitigate the downsides of sharing, I think it makes sense to have each token only work once. If we do that, then all you have to do is resubscribe once and stop sharing emails to the wrong people. For instance, we could have an unsubscribeId in the db that gets regenerated each time the user subscribes. That doesn't feel MVP worthy, though. |
This should differentiate it from the other email variables
|
@gikf since I picked a slightly too generic name for the secret, I went ahead and changed it. |

Update README.md).mainbranch of Chapter.To do
Very drafty, some parts are just put in the appropriate places, some are waiting for new roles (actual mutation)./unsubscribe?token=${token}route. With signed token including user id, whether it's chapter or event subscription and id of the element. As that information is in token, I'm not sure if it's worth to use more detailed links.batchSenderallowing sending multiple emails, with changed subject/text per recipient, it expects generator function yielding at least email address, subject and text.