Change user email without email verification

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.

1 Like

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

1 Like

Looks like this is possible from the API.

2 Likes

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

./launcher enter app
rails c
u = User.find_by_email('old_email_address')
u.email = 'new_email_address'
u.save!
7 Likes

This no longer works. The new way is:

4 Likes