Abstract notification destinations


Well-known member
By default XenForo has 3 (that I can think of) types of notification destinations:
  • XenForo Alerts
  • Push
  • Email (for some things)
They are all independent methods/destinations, but serve the same general purpose.

So what if XenForo had an alert system that had notification destinations for each user? The xf_user_push_subscription table is already a one-to-many relationship (each user can have multiple push destinations), so it could be done with the addition of one more column in that table (a destination handler identifier)

This would allow notification destination handlers to offer more flexibility, for example:
  • Apple'a proprietary Safari Push system (I wouldn't recommend it, it's just an example)
  • Webhook endpoint that advanced users could use
  • Notifications via 3rd party messaging apps
    • Telegram
    • Slack
    • Discord
    • Group Me
    • etc.
  • Some unknown future way to get notifications
Not so coincidentally, I've already built a system that piggybacks XenForo's normal notification system to allow those alerts to be sent to various third-party messaging platforms (and it works fantastically well).

A big part of this was a way to work around getting push notifications on any device (for example iOS).

I've actually been doing alerts like this in XenForo since XF 1.x (since 2016) for one of my sites:

For XF 2, I've made it more generic so it can be used with any XenForo site...

This is how it looks for one of my sites (normal default XenForo alerts work the same)...




Last edited:
Upvote 10
Top Bottom