Page 1 of 1

Email username and password after creating a new user

Posted: Tue Sep 27, 2016 6:03 pm
by FTP
If you want to email USER/PASS after creating a new user, then you can modify the file "webadmin/admin_adduser.html", find this line: AddUser(domain,user)

And insert the following line below it:

c_SendMail(user.note_email,"Your account name and password","Your account name and password<br>Username: "..user.username.."<br>Password: "..user.password,"","SMTP_CONFIG")

Here, user.note_email is the email address defined at "User -> Notes -> Email address", SMTP_CONFIG is the SMTP configuration name, you can add a SMTP configuration at "Server > Settings > SMTP Manager".

And if you want to force user changing his password, just check on this option "Domain > Settings > General Settings > Password & Security > Need to change the password on the first logon".

Re: Email username and password after creating a new user

Posted: Fri Sep 30, 2016 10:19 am
by impact
About forcing password change is it possible to choose it at user and not and domani level?
We have different kind of users some of which need to change password and other who must not change it.

Thank you

Re: Email username and password after creating a new user

Posted: Thu Dec 15, 2016 12:01 pm
by JohnCooper
What do I need to add that this email gets only sent when the field is not empty or will it do that anyways?

Re: Email username and password after creating a new user

Posted: Thu Dec 15, 2016 1:39 pm
by FTP
Do you mean the "note_email" field? If it is empty, of course you can't send the email successfully.

Re: Email username and password after creating a new user

Posted: Thu Feb 09, 2017 10:48 pm
by danipapi
First, you need to add the c_SendMail function before the AddUser function to not send md5 password to your user.

The c_SendMail function seems to work only when connected as main Admin, when it is an admin limited to some domains, it is not working. No email was sent.

Do you know why ?

Regards 1

Re: Email username and password after creating a new user

Posted: Thu Feb 23, 2017 4:29 am
by FTP
Yes, the Lua API "c_SendMail" can be used by the system admin only.