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

Users don't have permission to view a custom alert

Discussion in 'XenForo Development Discussions' started by Lyphiard, May 30, 2016.

  1. Lyphiard

    Lyphiard Active Member

    I'm having an interesting problem with one of my addons that will send a user a custom alert. To send them an alert, I use the following code:

            array('postId' => $postId)
    Users will receive the alert (there will be the little red flag that shows they have a new alert), but as soon as they hover over the alerts button, it quickly disappears and nothing shows up.

    The interesting thing is that if I edit the user's permissions and allow them to see deleted content/threads, the alert will show up for them, even if they previously were not able to see it.
  2. Nobita.Kun

    Nobita.Kun Well-Known Member

    If you use content type of 'post'. You should assign content ID is post_id instead of thread_id.
  3. Lyphiard

    Lyphiard Active Member

    Thanks! Changing it to $postId still doesn't fix the problem with the notifications only showing up for users with the view deleted posts permission though.
  4. Lyphiard

    Lyphiard Active Member

    I finally resorted to creating a custom content_type, which finally allowed me to send the alert properly.

Share This Page