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

Keep getting notifications on previous email address #11494

Open
javibits opened this issue Nov 19, 2020 · 19 comments
Open

Keep getting notifications on previous email address #11494

javibits opened this issue Nov 19, 2020 · 19 comments
Labels
area: comments & notifications area concerning interactions or notifications with user bug smash Approved bugs for the DEV community bug smash bug always open for contribution external contributors welcome contribution is welcome!

Comments

@javibits
Copy link

Describe the bug
If you change the email address in your profile, you keep getting email notifications on your previous address even after you have confirmed the new one

To Reproduce

  1. Go to 'Settings > Profile'
  2. Under 'User' section, change the email
  3. Open email sent to new address and click 'confirm my account'
  4. See error -> Keep getting email notifications on previous address

Expected behavior
After confirmation of new email address, all email notifications should be sent to that address and not to the previous one

Desktop (please complete the following information):

  • OS, version: Linux Mint 19.3
  • Browser, version: 78.0.1 (64-bit)
@github-actions
Copy link
Contributor

Thanks for the issue! We'll take your request into consideration and follow up if we decide to tackle this issue.

To our amazing contributors: issues labeled type: bug are always up for grabs, but for feature requests, please wait until we add a ready for dev before starting to work on it.

To claim an issue to work on, please leave a comment. If you've claimed the issue and need help, please ping @forem/oss and we will follow up within 3 business days.

For full info on how to contribute, please check out our contributors guide.

@rhymes
Copy link
Contributor

rhymes commented Nov 19, 2020

Thanks @javitruhlar for notifying us of this issue. If I read this right, the issue is not that inherently that the system sends you notifications to the old address, is that the new one cannot be confirmed, right? So if it's not confirmed, the system won't change it

@rhymes rhymes added area: email bug always open for contribution labels Nov 19, 2020
@javibits
Copy link
Author

I think the new address was confirmed without a problem. After confirmation I was able to login with new address but kept getting notifications on the old one.
To get notifications on new address I went to notification settings and saved them

@taismassaro
Copy link

I think I'm having a similar issue, but in my case I'm getting all emails from DEV on both emails since I changed my email address.

@nickytonline
Copy link
Contributor

@taismassaro, this is a confirmed issue. @rhymes, this issue also happens to me. I signed up with GitHub and when I started working at Forem, I switched my e-mail (confirmed it as well) to my Forem one and now I receive two emails whenever one is sent out.

@cmgorton cmgorton added bug smash Approved bugs for the DEV community bug smash external contributors welcome contribution is welcome! labels May 4, 2021
@kitarp29
Copy link

kitarp29 commented May 5, 2021

@rhymes @nickytonline
I would Love to work on this issue

@nickytonline
Copy link
Contributor

Sounds great @kitarp29! Assigning it to you now.

@citizen428
Copy link
Contributor

@nickytonline @rhymes Is this essentially https://github.com/forem/internalEngineering/issues/367? It's on our current cycle board but nobody has picked it up yet. We may want to remove it from there to avoid duplicated effort.

@cmgorton
Copy link
Contributor

cmgorton commented May 6, 2021

I'll mention it in our meeting today Michael so that it can be removed from the current cycle board. Thanks for pointing that out.

@kitarp29
Copy link

Sorry, I am looking at it after a week.
I get this bug is happening as the email id is probably not updated or not replaced in the DB.
I am unable to find the file where the Schema of the user is set.
I will looking for it, if someone could direct me to the file it would be of great help.

@cmgorton
Copy link
Contributor

Hey @kitarp29 I am copying over a comment from one of our engineers that was in the internal issue.

"Gut reaction is that this happens because when a user updates their email, we don't unsubscribe their old email.

Relevant files are app/services/mailchimp/bot.rb, app/models/user.rb#subscribe_to_mailchimp_newsletter, and app/workers/users/subscribe_to_mailchimp_newsletter_worker.rb. "

Let me know if that helps. If not I can ping one of our engineers 😀

@kitarp29
Copy link

Sorry I have been trying to wrap my head around the code to find the bug.
But I am unable to do it. If anyone wants to do it, He/She should be assigned this issue.

@citizen428
Copy link
Contributor

Thanks for giving it a shot @kitarp29, much appreciated! ❤️ I un-assigned you from this issue now so people can see it's still up for grabs.

@kitarp29
Copy link

This #11494 (comment) will really help someone who is trying to solve this issue.
As far as I could understand there is a function unsubscribe_to_newletter, but I am unable to figure out why it's not working.
The function is called when the user changes the email id.

@takmar
Copy link
Contributor

takmar commented May 25, 2021

Could I take this?

@cmgorton
Copy link
Contributor

Yes, I will assign it to you @takmar . Thanks for your help!

@cmgorton
Copy link
Contributor

cmgorton commented Aug 6, 2021

@takmar Hey! I wanted to check in and see if this is an issue you would still like to work on? If not, I can unassign you from it. Thanks again for the help here.

@dbarwikowski
Copy link

dbarwikowski commented Aug 11, 2021

Shouldn't it always take user.email?

def target_md5_email
email = saved_changes["unconfirmed_email"] ? saved_changes["email"][0] : user.email
md5_email(email)
end

result of this function (?) is used in update to mailchimp:
def upsert_to_newsletter
# attempt to update email if user changed email addresses
success = false
begin
gibbon.lists(Settings::General.mailchimp_newsletter_id).members(target_md5_email).upsert(

Or maybe the request to mailchimp should take into account that user might be unsubscribed?

email_address: user.email,

@thomasbnt
Copy link
Contributor

Same issue 👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: comments & notifications area concerning interactions or notifications with user bug smash Approved bugs for the DEV community bug smash bug always open for contribution external contributors welcome contribution is welcome!
Projects
None yet
Development

No branches or pull requests

10 participants