freeCodeCamp icon indicating copy to clipboard operation
freeCodeCamp copied to clipboard

Update unsubscribe functionality for edge case

Open QuincyLarson opened this issue 4 years ago • 4 comments

Every week I get maybe 5 or 10 emails from email blast recipients who say they can't successfully unsubscribe from the email list, and I have to manually go into the database and do this for them.

Some people have more than one freeCodeCamp account associated with the same email address. This is due to an old bug that I think we've fixed. But there are still a lot of accounts in the database like this.

We may never get around to merging these since it's somewhat manual process. But we can fix one of the biggest issues related to them by fixing our unsubscribe functionality.

Currently when you attempt to unsubscribe from the weekly freeCodeCamp email newsletter, if you happen to have more than one account with the same email address, you will get an error message.

Instead, we want to re-write this logic so that all accounts with that same email address get unsubscribed.

QuincyLarson avatar Jan 24 '21 18:01 QuincyLarson

I do intend to separate the email (sign-up, subscribe & unsubscribe) as a dedicated micro-service of its own. If this can possibly wait to be in tandem with the Loopback migration, we could strike a lot of issues with a refactor including the duplicate accounts issue.

raisedadead avatar Jan 28 '21 09:01 raisedadead

~~Going to run the merge dupes script today to at least address the underlying bug.~~ We need to coordinate a time to run this nvm.

We should look in to the API endpoint and validate the query that is being run.

Mrugesh proposes: Creating a separate app to handle this logic specifically, having NGINX route /ue to that app, and allowing that app (without loopback) to look up the documents by username/email/etc and unsub those too.

naomi-lgbt avatar Jun 22 '22 14:06 naomi-lgbt

Based on our current progress, the new plan for this is:

  1. I will add the below functionality to the new api
  2. Once we deploy the new api, this issue should be closed
  3. POST MVP of the new api will focus on improvements like splitting the signup, subscribe, unsub endpoints

Functionality to add:

  • on /ue/:unsubscribe_id:
    • Find DB record with unsubscribeId
    • Get related email address
    • Find ALL records with matching email address
    • Unsubscribe ALL records - regardless of unsubscribeId

ShaunSHamilton avatar May 23 '24 14:05 ShaunSHamilton

@raisedadead Can this roadmap item be closed now? New to GitHub so I'm not sure

callummscott avatar Oct 02 '24 22:10 callummscott

Tentatively closing.

ShaunSHamilton avatar May 15 '25 23:05 ShaunSHamilton