0
sbenfares created
Hi,
I would like to add a custom "Link" field in a User Notification.
I've created a class MessageAndLinkNotificationData :
[Serializable]
public class MessageAndLinkNotificationData : MessageNotificationData
{
public string Link { get; set; }
public MessageAndLinkNotificationData(string message, string link) : base(message)
{
Link = link;
}
}
When i try to retrieve the data in my controller :
var dto = await _userNotificationManager.GetUserNotificationAsync(AbpSession.TenantId, userNotificationId);
var model = new MessageDetailViewModel(dto.Notification.Data.Properties["Message"].ToString(),
dto.Notification.Data.Properties["Link"].ToString(),
dto.Notification.CreationTime);
I have an error : ** 'NotificationData' does not contain a definition for 'Link' and no accessible extension method 'Link' accepting a first argument of type 'NotificationData' could be found **
What is the best practise to customise User Notification ?
Thanks
2 Answer(s)
-
0
Hi @sbenfares
Ifyou want your notification to be clickable, you can check current implementation of Download collected data feature.
Here is the implementation details https://github.com/aspnetzero/aspnet-zero-core/issues/1208
It generates a clickable notificaiton.
-
0
Thanks it helped !