Abstract notification destinations

digitalpoint

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:
1657731722250.png

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

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

XenForo:
1657731478154.png

Telegram:
1657731518246.png

Slack:
1657731574474.png

Discord:
1657731611533.png
 
Last edited:
Upvote 10
Top Bottom