Combu
3.2.2
Unity API Documentation
|
In this section you will learn how to setup your server to send email to clients and reset the user's password.
To enable sending mails to your users you need to set REGISTER_EMAIL_REQUIRED to TRUE in /lib/config.php and start to store the users email address.
If you want to send an email as welcome after registration then you also need to set REGISTER_EMAIL_ACTIVATION to TRUE, then set your custom message for subject in REGISTER_EMAIL_SUBJECT and a file name (it must exist in /email_templates) in REGISTER_EMAIL_MESSAGE.
We suggest to create a copy of /email_templates/email_register.html and use it as your own, same for any other sample files that you find in /email_templates which may be overwritten during updates).
The built-in method User.ResetPassword (to reset the password of a user when it has been lost) sends a random generated code by email to the user, so this feature also requires REGISTER_EMAIL_REQUIRED to TRUE. In your interface you need a frame where he can input the code received by email and you call User.ChangePassword like here:
You can customize the email sent to the user by setting RESETPWD_EMAIL_SUBJECT and RESETPWD_EMAIL_MESSAGE (same as above for REGISTER_EMAIL_*).