@pichalite yep it looks like this worked now when i tested! Tnx alot!
@julian it looks like i got my stuff working now 😉 Im helping Beam.Pro on they forums for the beam login plugin 😉
I want to send a notification to a group when a certain event is triggered. This notification is not related to any new topic or mention.
For example, I want to send a notification to the admin group when a new user is registered and the nodebb-plugin-newuser-approval plugin is active.
Yeah just create the notification with notifications.create
then use notifications.pushGroup
and pass the notification object.
notifications.create({
nid: 'plugin:new_user:' + theiruid, // a unique notification id
bodyShort: 'a new user is waiting approval'
path: 'admin/plugins/approval', //clickin the notification will take user to this link
from: theiruid // this will cause the new users image to appear with the notification
}, function(err, notification) {
if (err) {
return callback(err);
}
notifications.pushGroup(notification, 'administrators', callback);
});
@baris thanks. Creating the notification works but when I click on the notification, it takes me to admin/plugins/approval but with client css applied and settings don't get loaded. Refreshing the page applies the admin css and displays ACP menu.
Does it ajaxify to admin/plugins/approval? It should do a cold load, if not we should fix that.
@baris It does not do a cold load. This is what it looks like when I click on the notification.
Sounds like notifications need a way to open the link in a new tab.
@baris you should detect whenever anything is going to /admin/...
and automatically open it in a new tab.
@pitaj @pichalite gh#2849
@julian one problem. when I click on the notification, it's opening the same link in current tab and in a new tab.
@pichalite looking at the code, that shouldn't be happening. Hmmm...
@baris doesn't seem to be fixed. Still same issue.
Is the relevant code in public/src/ajaxify
?
@pichalite Try with https://github.com/NodeBB/NodeBB/commit/f89741636cdad244d38bf2c8dca52054f65c335c
Let me know if that works.
Can you try again on latest.
@baris works now, thanks.