1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Send user alert from external script

Discussion in 'XenForo Development Discussions' started by DeweySalt, Mar 5, 2016.

  1. DeweySalt

    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.
  2. DeweySalt

    DeweySalt New Member

    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:

    $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"));

Share This Page