Base solution for your next web application
Open Closed

Request for Notifications Category/Tag #11887


User avatar
0
lschelvan created

I have a number of notifications in my app. I'd like to add a Category or Tag property to the NotificationDefinition so that I can organize them in the user notification settings UI.... something like this (where I have Category 1 and Category 2)...

Is there any way to do this with the current Abp Notifications? (And if not, can this be considered as a feature for a new version?) Thank you.


5 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    You can store custom data in Notification Data, see https://aspnetboilerplate.com/Pages/Documents/Notification-System#notification-data

    Here is a sample usage;

  • User Avatar
    0
    lschelvan created

    We do store custom data in the notification itself, but what I'm really looking for is a simple way to apply a hierarchy or grouping to the notification list in the settings (which doesn't even need to affect the notifications themselves). (see screenshot)

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    In that case, you can try https://docs.aspnetzero.com/en/aspnet-core-mvc/latest/Extending-Existing-Entities to add a new field to Notifications.

  • User Avatar
    0
    lschelvan created

    I don't want to add a new field to the Notifications - all I really want to do is add a field or property to the NotificationDefinitions, so that they can be displayed in the notifications settings UI (see my first screenshot). This won't affect the actual Notifications at all.

    I tried to extend the existing NotificationDefinitions, but it looks like that class is in the ABP core and can't be touched without access to that source code.?.

    I am only trying to organize the UI so that we have several categories.... is there some other possible way to do this?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Thanks, got it. What about setting it like this;

    notificationDefinition["Category"] = <any serializable object>