This topic is locked

Notification to Group not working

2/4/2023 9:19:06 PM
PHPRunner General questions
mic'',) author

I wonder if notification to group is really work.

I tried this

$permissions = array('group'=>'<Admin>');

addNotification('Name: '.$values['Firstname'].', '.$values['Lastname'],'ADDED NEW EMPLOYEE','fa-user',
makePageLink('employees','view',$keys),null,$permissions,false);

I tried numerous times but if the notification appears to all users, except if you directly replace the $permission to username, but it will only send to individual users not in the group.

uhhmmmmm any workaround? tho this code from druck281 works https://asprunner.com/forums/topic/28954-Notification-API--multiple-users, I think the 10.9 version will send directly to group than creating manual coding.

$currentUser=$_SESSION["UserName"]; //Setting current user to variable for use in the comparison for the "if" statement
$rs = DB::Query("SELECT * FROM trax_ugmembers WHERE GroupID=12 OR GroupID=3"); //Fetch an array of usernames from the given user groups
while($data = $rs->fetchAssoc() )
{
//The "If" statement serves to skip over creating a notification for the user that created the record
if ($data["UserName"] != $currentUser) {
//Calls the Notification API. At testing the makePageLink() function was not producing the $keys value so the URL was hardcoded
addNotification("New Crash Number: ".$values['CrashNumber'], "Crash Added", "glyphicon-send", "pat_CrashNumberAssign_edit.php?editid1=".$values['CAD_Number'], $expire=5, $data["UserName"]);
}
}

All the best
-mic