SychO Notifications are coming from the API, which means they must be processed on the backend.
I believe this issue is on the frontend, specifically in the js/forum side. After my trial-and-error attempts and reviewing the code structure in extensions like flarum/likes, I’ve come up with two possible explanations.
1. Extending NotificationGrid
Using NotificationGrid, I suspect I need to extend the notification type in a similar way to this:
extend('flarum/forum/components/NotificationGrid', 'notificationTypes', function (items) {
items.add('postLiked', {
name: 'postLiked',
icon: 'far fa-thumbs-up',
label: app.translator.trans('flarum-likes.forum.settings.notify_post_liked_label'),
});
});
No matter how many variations I try, I haven’t been able to get this working.
2. Subject ID and Data Mapping
Even though all notification types include subjectId in their models, they always associate it with posts, discussions, or users via a column in their own database.
I can't do that. I am only matching it with the id column in my own database.
I suspect this could be the issue.
Why must I match the notification type's ID?
Because I need to send bulk notifications to all members.
If I associate subjectId with users, then if the notification type ID does not match a user/post/discussion ID, the notifications will be hidden on the frontend. That’s why I can't do this.
I must retrieve subjectId only using the id from my notification_types table. Additionally, I cannot associate this ID with users, posts, or discussions.
I've explored every solution I could think of and examined all modern Flarum/fof extensions using the notification system. In the end, they all rely on association.
flarum/suspend seems the most different, yet it still associates with users.