Try our conversational search powered by Generative AI!

INotifier examples - documentation not clear

Vote:
 

I'm still confused after reading these two documentation pages.

https://docs.developers.optimizely.com/content-management-system/docs/using-notifications

https://docs.developers.optimizely.com/content-management-system/docs/usage-examples

I've implemented the:

private static readonly INotificationUser NotificationSender = new NotificationUser("SystemNotificationSender");
public const string NotificationChannelName = "ExecutableJob.Invoke.Process";

await _notifier.PostNotificationAsync(new NotificationMessage
{
    ChannelName = NotificationChannelName,
    Subject = broadcasted.Subject,
    Content = broadcasted.Message,
    Recipients = new[] { new NotificationUser(broadcasted.UserName)  }, // Logged in User
    Sender = NotificationSender,
    TypeName = "OnStatusChange"
}

and in startup:

var optionsRegistry = app.ApplicationServices.GetRequiredService<INotificationChannelOptionsRegistry>();
optionsRegistry.Add(...NotificationChannelName, new NotificationChannelOptions(true));

I do not need to format it in a special way I just want it displayed as is, but nothing is shown in the "notifications" tab.

What am I missing?

Do I need to implement my own notification handling?

https://docs.developers.optimizely.com/content-management-system/docs/usage-examples#retrieve-user-notifications

Or my own subscription thing?

#317400
Feb 20, 2024 9:12
Vote:
 

Hi Carl

For the notifications icon, there should be no channel filtering. It should show all notifications for the user.

Have you confirmed that the notifications are stored correctly in the database? And that the receiver user name matches the one in your session, exactly?

Does it show up if you omit the recipient (emulating a general notification for all users)?

#319692
Mar 29, 2024 15:13
Vote:
 

Hi Stefan,

I just gave up since no one answered in such a long time and went with SignalR instead which made it easier.

#319864
Apr 02, 2024 5:04
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.