Change user email without email verification


(Philipp) #1

Hi there.

I know I can impersonate a user and manually change their email address. But then it sends out an email with a confirmation link. Any way I can avoid this last step? Happy to do this in SQL, just not sure what the SQL credentials are and which field I’d need to edit?

Background: I am dealing with a bunch of elderly users. They can’t correctly configure their account (particularly around notification settings) so I do it for them. I start with my own email address to be able to do the initial account verification. Then I’d change the account to their email address but half of these guys can’t even click on the verification link. So I need to avoid having them to.


(Jeff Atwood) #2

You would need to do this at the Ruby command line inside the Discourse Docker container.


(Jay Pfaffman) #3

Looks like this is possible from the API.


#4

My own admin account has an old email that does not exist anymore and I can’t change it as the verification email can’t be sent. Can and how should I do in in the cli?

Best regards,
Neso


(cpradio) #5
./launcher enter app
rails c
u = User.find_by_email('old_email_address')
u.email = 'new_email_address'
u.save!

(Stephen Chung) #6

This no longer works. The new way is: