MyChat Scripts Engine: mGetUserPrimaryEmail, getting a user's primary email address
"For developers", "Server scripts", "Functions description", "Users", "mGetUserPrimaryEmail".
Function to obtain the main email address of a user by his UIN.
Syntax
function mGetUserPrimaryEmail(iUIN: integer): string;
Parameters and return values
Parameter |
Type |
Value |
iUIN |
integer |
unique user identifier, from which you need to obtain the email. |
Function result
User's email address. If there is no user with such ID on the server or the email field is empty, the function returns an empty string. If you request UIN = 0, the function will get the email address of MyChat Server administrator, that can be specified in the server's settings.
Example
var
sElisaEmail: string;
begin
sElisaEmail := mGetUserPrimaryEmail(0);
mLogScript('Server administrator''s email is: ' + sElisaEmail, '');
end.
Script work result
[17:35:46] (Log "mGetUserPrimaryEmail"): Server administrator's email is: hobit@nsoft-s.com
[17:35:46] (Run "mGetUserPrimaryEmail"): Script operation time: 2 ms
[17:35:46] (Run "mGetUserPrimaryEmail"): Script done successfully.