كيف يمكنني تغيير البريد الإلكتروني الأساسي للمستخدم؟

As an administrator, how can I change a user email address ?

هناك العديد من الموضوعات التي تناقش هذا الأمر. يمكنك زيارة صفحة ملف المستخدم وتعديلها، لكنهم سيظلون بحاجة إلى التحقق من عنوانهم، وهو ما يُعدّ دائمًا فكرة جيدة تقريبًا.

إذا أردت أن تتولى الأمر بنفسك، فيمكنك فعل ذلك من خلال وحدة تحكم Rails. إنها أكثر أمانًا من استعلامات قاعدة البيانات المباشرة.

قد يعمل هذا:

u=User.find_by_username("pat") 
UserEmail.find_by(user_id: u.id).first.update (email: "pat@gmail.com")


7 إعجابات

I can not use the console has we are hosted on trydiscourse.com.

What do you mean by visiting ? If I go to the user page as an administrator, I can edit username and name for example but not the email.

Scroll down to bottom then you will see an impersonation button if your as an admin

إعجابَين (2)

Yes indeed, it’s how I do it now. But after impersonation, I need to logout to go back to my administrator account. I hoped there was a better way.

Seems no possible for now

Oh. The email isn’t verified yet? So they aren’t really even a user. I think I’d just delete the account and have them try again.

إعجابَين (2)

@pfaffman Good point. I will go for account delete.

@hawm Thank s for the link I will track it.

إعجاب واحد (1)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.