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

Documentation for alerts?

Discussion in 'XenForo Development Discussions' started by KoolKrafter, Apr 24, 2014.

  1. KoolKrafter

    KoolKrafter Member

    I have searched the XenForo forums and the internet, as well as looked through the code, and I cannot figure out how the alerts work!
    Is there any kind of documentation on this, or can someone provide a quick tutorial on how to get an AlertHandler set-up and sending alerts, etc?

  2. KoolKrafter

    KoolKrafter Member

    Well I figured it out. I was wondering if there was any easy way to alert users with a specific permission other than looping through all the users?
  3. KoolKrafter

    KoolKrafter Member

    For anyone interested, I worked this out. Was kinda tricky, I had to loop through the xf_permission_entry table and get all the users and groups with the permission. I then fetched the users from the groups and alerted them. I also had to make sure that the permission wasn't denied anywhere. If anyone wants the code for it, PM me! :)
  4. Hunter

    Hunter Member

    Could you elaborate on how alerts work? A "How to create custom alerts" tutorial would be a great addition to this board imo.
  5. NixFifty

    NixFifty Well-Known Member

    Bit late, but this post by Chris D was what helped me understand how alerts work and how to implement them successfully.

    Aayush likes this.
  6. KoolKrafter

    KoolKrafter Member

    Yeah, that was what I figured it out from too I think.

    A few things to remember: If the alert count goes up but the alert isn't shown, that means that you haven't set up your content type correctly. Remember that XenForo doesn't automatically add your content type, you need to run a query on install. This add-on helps create the content types and gives you the SQL queries to insert them in your installer.
    Another easy way to figure it out is to look at an add-on that uses alerts and see how they do it.

Share This Page