November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
Yes, there's a notification areas in the upper right corner of Episerver that allows notifications to the user. Out of the box this is used for areas such as content approval notifications however you can easily hook in to this for custom notififcations
https://world.episerver.com/documentation/developer-guides/CMS/using-notifications/
Hi Scott,
Thank you. Yes it can be used but it does not seem like you can remove messages again.
An editor logs in, and gets a notification that something needs to be done (type in license key, configure etc..) Then when that is done and you return the page, the message persist. I have read that it truncates every night, but is there a programatically way of removing messages?
I don't believe so, it's just a notification dispatcher and it's up to the user to click the message so it's marked as read. I've had a look at the underlying code and there is a delete method in the INotificationRepository but the implementation class DefaultNotificationRepository is marked as Internal so it won't work if you inject it and it would be difficult to create your own implemtation as the DefaultNotificationRepository uses NotificationMessagesDB which is also internal.
However if you really need this the code for the direct database access in the NotificationMessagesDB is
internal async Task DeleteAsync(IEnumerable<int> messageIds) { IAsyncDatabaseExecutor db = this.Database; await db.ExecuteTransactionAsync((Func<Task>) (async () => { DbCommand cmd = db.CreateCommand(); try { cmd.CommandText = "netNotificationMessagesDelete"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddIntListParameter("@MessageIDs", messageIds); int num = await cmd.ExecuteNonQueryAsync().ConfigureAwait(false); } finally { if (cmd != null) cmd.Dispose(); } cmd = (DbCommand) null; })).ConfigureAwait(false); }
So you could call this stored procedure yourself with the list of IDs pretty easily.
Thank you Scott.
Then it is close to useless in the sense we are looking for.
I will mark your reply as answer.
Do Episerver provide a field or a notification where you can send message to editors? Most CMS systems have some sort of message handling system. For instance if there is a plugin installed but it is not registered, then you could post a message to the editor in edit mode, to either go to settings to register or configure or similar.