To send PMs to more than 1 user:
Retrieving usernames:
To get a list of usernames from an array and output in the form of user1;user2;user3:
PHP Code:
$user_names = $db->query_read("
SELECT username
FROM " . TABLE_PREFIX . "user
WHERE usergroupid = xx
ORDER BY username ASC
");
replacing xx with usergroupid
PHP Code:
$pmto_users = array();
while ($name = $db->fetch_array($user_names))
{
$pmto_users[] = $name['username'];
}
$db->free_result($user_names);
To output the $pmto_users array into the format user1;user2;user3 you do:
PHP Code:
$pmtousernames = implode(';', $pmto_users);
Finally, sending the pm -repeat all the steps mentioned by KirbyDE but replace
PHP Code:
$pmdm->set_recipients('newuser', $botpermissions);
with:
PHP Code:
$pmdm->set_recipients($pmtousernames, $botpermissions);
[$pmtousernames would output to something like user1;user2;user3;etc]