Send user alert from external script

DeweySalt

New member
Hello, I'm trying to send a custom user alert from an external script that handles connections to our client application. I've located alertUser() within Xenforo_Model_Alert which seems to be what I'm looking for, although a lack of documentation has left me to guessing what half of the variables require. Any help would be highly appreciated.
 
Update: Ended up figuring it out myself. For anyone else looking to do this, here's a snippet of the code I used after initializing the autoloader and grabbing the viewing user info:

PHP:
$alertModel = XenForo_Model::create('XenForo_Model_Alert');
$alertModel->alertUser($userinfo["user_id"], 0, $userinfo["username"], "user", 1, "from_admin", array("alert_text" => "Your custom alert text here"));
 
Top Bottom