How do I change my primary email

Having an issue where the primary email for my membership as lead community manager changed years ago. The company that owned it before shut down the email address and now I cannot change the email in the discourse because it says sending to the previous email. It is stopping me from approving the new managers/admin/moderators. Is there a way to change email without sending to previous email?

Let me know if this problem is clear or has happened before?

If you’re the only admin then you will need to update your account via the rails console.

If you don’t have root access to the server then whoever hosts the instance will need to do this for you.

2 Likes

If there is another admin, then you remove admin from your account so that you can change email, then have them make you admin. Or use console as described.

1 Like

Hi there, the solutions did not work with revoking admin and getting my colleague to try change it for me. Still sent confirmation to my old address that does not exist even if my colleague changed it. I guess i will try to contact the programmers who set up the instance but that comes at a cost.

Did the other admin change your email, or did you attempt to do it?

If an admin changes the email of a non-admin user then it doesn’t send an email to the old account.

1 Like

If you have ssh access to the server you can do this:

cd /var/discourse
./launcher enter app
u=User.find_by_email('old@email.address')
u.email='new@email.address'
u.save;
exit
exit

But I just confirmed that for a regular user, no email is sent to the current email address. Perhaps your account is both an admin and a moderator? (I didn’t test if moderator accounts can be changed without notifying the old address).

A notification email is sent to the old address, but the confirmation email is sent only to the new address.

2 Likes

I can confirm that for a moderator it behaves the same as for admin accounts. I had this exact issue with one off my moderators a few months ago and ended up going the rails route to change it.

2 Likes

This makes the hypothesis that they removed admin, but not moderator rights from the admin in question and that’s why they are unable to change the email address without confirmation going to the old address seem all the more likely.

Hey @MAR you’ll need to ask your colleague to remove your moderator rights too. If you log in now do you see “admin” in the hamburger menu? Can you access any moderation functions?

1 Like

Hi there,

My colleague helped me and it still says sending email to “that address” and nothing comes to my new address. So my colleague has given me back my Admin and Moderator status. Will have to see about the SSH server option you mentioned

“that address” is the new address. If you’re not getting it, check your spam, and if you’re using a mask service maintained by Microsoft, consider getting another one, but also have someone do a test to mail-tester.com as described in Troubleshooting email on a new Discourse install.

Hi. I hope it’s OK to continue this thread instead of starting a new one. I’m in the same boat as the original poster. I’m the admin for my discourse instance, and I dropped my personal domain before changing my email in Discourse.

I tried @pfaffman Jay’s suggestion to use the console to make the change, but am getting a bash syntax error with this line

u=User.find_by_email('old@email.address')

I substituted my old email address of course, but get this error:

bash: syntax error near unexpected token `('

Might the find_by_email method have changed in the past year? Sorry but I don’t really know Rails. I’m getting better at ssh’ing into the server and moving about though.

Before typing those commands do this

cd /var/discourse 
./launcher enter app 
rails c 

Then do the stuff you’re trying to do. Type exit a few times to get out of all of the stuff.

1 Like

Thanks! that worked 100%.

1 Like