Documentation

OnSendUserInfo

handler function(
  array &arParams
);
The event OnSendUserInfo fires in the method CUser::SendUserInfo and is designed to re-define parameters for sending mail event USER_INFO.

Parameters

ParameterDescription
arParams Array of fields to check login name and password:
  • FIELDS - Array containing the Array("field 1"=>"value 1", ...) set of fields. All the passed fields are processed by the USER_INFO template. By default the array contains the following fields:
    • "USER_ID" - user ID,
    • "STATUS" - active state text,
    • "MESSAGE" - message text,
    • "LOGIN" - login name,
    • "CHECKWORD" - checkword,
    • "NAME" - user name,
    • "LAST_NAME" - last name,
    • "EMAIL" - e-mail address
  • USER_FIELDS - All user fields, which data will be sent.
  • SITE_ID - site ID, used to define USER_INFO mail event template.

Note Parameter and array elements arParams passed to this handler function are references to original variables. Therefore, all changes to parameters made within the handler affect values of the original variables.

See Also

  • [link= 6658392]CUser::SendUserInfo[/link]
  • Events

Example of handler function:

<? 
// file /bitrix/php_interface/init.php
AddEventHandler("main", "OnSendUserInfo", "MyOnSendUserInfoHandler");
function MyOnSendUserInfoHandler(&$arParams)
{
if(strlen($arParams['USER_FIELDS']['LAST_NAME'])<=0)
$arParams['FIELDS']['CUSTOM_NAME'] = $arParams['USER_FIELDS']['LAST_NAME'];
else
$arParams['FIELDS']['CUSTOM_NAME'] = $arParams['USER_FIELDS']['LOGIN'];
// now USER_INFO template can use the macro #CUSTOM_NAME#
}
? >


© «Bitrix24», 2001-2022
Up