Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test functions

send_user_message()

Description

Send a user to user(s) message

Parameters

ColumnTypeDefaultDescription
$users array Array of user IDs or usernames/groupnames from user select
$text string Message text

Return

bool|string True if sent ok or error message

Location

include/message_functions.php lines 946 to 964

Definition

 
function send_user_message($users,$text)
    {
    global 
$userref$lang;
    
$users=explode(",",resolve_userlist_groups($users));
    for(
$n=0;$n<count($users);$n++)
        {
        if(!
is_int_loose($users[$n]))
            {
            
$uref get_user_by_username(trim($users[$n]));
            if (!
$uref)
                {
                return 
$lang["error_invalid_user"];
                }
            
$users[$n] = $uref;
            }
        }
    
message_add($users,$text,"",$userref,MESSAGE_ENUM_NOTIFICATION_TYPE_USER_MESSAGE MESSAGE_ENUM_NOTIFICATION_TYPE_SCREEN,30*24*60*60);
    return 
true;
    }

This article was last updated 4th December 2024 08:35 Europe/London time based on the source file dated 27th November 2024 15:30 Europe/London time.