diff --git a/src/Umbraco.Core/Constants-WebhookEvents.cs b/src/Umbraco.Core/Constants-WebhookEvents.cs
index afd57b5188ef..41b9849f08f1 100644
--- a/src/Umbraco.Core/Constants-WebhookEvents.cs
+++ b/src/Umbraco.Core/Constants-WebhookEvents.cs
@@ -6,6 +6,57 @@ public static class WebhookEvents
{
public static class Aliases
{
+
+ ///
+ /// Webhook event alias for content versions deleted
+ ///
+ public const string ContentDeletedVersions = "Umbraco.ContentDeletedVersions";
+
+ ///
+ /// Webhook event alias for content blueprint saved
+ ///
+ public const string ContentSavedBlueprint = "Umbraco.ContentSavedBlueprint";
+
+ ///
+ /// Webhook event alias for content blueprint deleted
+ ///
+ public const string ContentDeletedBlueprint = "Umbraco.ContentDeletedBlueprint";
+
+ ///
+ /// Webhook event alias for content moved into the recycle bin.
+ ///
+ public const string ContentMovedToRecycleBin = "Umbraco.ContentMovedToRecycleBin";
+
+ ///
+ /// Webhook event alias for content sorted.
+ ///
+ public const string ContentSorted = "Umbraco.ContentSorted";
+
+ ///
+ /// Webhook event alias for content moved.
+ ///
+ public const string ContentMoved = "Umbraco.ContentMoved";
+
+ ///
+ /// Webhook event alias for content copied.
+ ///
+ public const string ContentCopied = "Umbraco.ContentCopied";
+
+ ///
+ /// Webhook event alias for content emptied recycle bin.
+ ///
+ public const string ContentEmptiedRecycleBin = "Umbraco.ContentEmptiedRecycleBin";
+
+ ///
+ /// Webhook event alias for content rolled back.
+ ///
+ public const string ContentRolledBack = "Umbraco.ContentRolledBack";
+
+ ///
+ /// Webhook event alias for content saved.
+ ///
+ public const string ContentSaved = "Umbraco.ContentSaved";
+
///
/// Webhook event alias for content publish.
///
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/en.xml b/src/Umbraco.Core/EmbeddedResources/Lang/en.xml
index 572fe05dd4bc..492cb762cf6b 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/en.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/en.xml
@@ -1941,6 +1941,7 @@ To manage your website, simply open the Umbraco backoffice and start adding cont
Create header
Logs
No webhook headers have been added
+ No events were found.
Add language
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml b/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml
index 33901735eec1..12fdf928c236 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml
@@ -2023,6 +2023,7 @@ To manage your website, simply open the Umbraco backoffice and start adding cont
Create header
Logs
No webhook headers have been added
+ No events were found.
Add language
diff --git a/src/Umbraco.Core/Webhooks/Events/Content/ContentCopiedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentCopiedWebhookEvent.cs
new file mode 100644
index 000000000000..3d6f0163d70b
--- /dev/null
+++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentCopiedWebhookEvent.cs
@@ -0,0 +1,37 @@
+using Microsoft.Extensions.Options;
+using Umbraco.Cms.Core.Configuration.Models;
+using Umbraco.Cms.Core.Notifications;
+using Umbraco.Cms.Core.Services;
+using Umbraco.Cms.Core.Sync;
+
+namespace Umbraco.Cms.Core.Webhooks.Events.Content;
+
+[WebhookEvent("Content Copied", Constants.WebhookEvents.Types.Content)]
+public class ContentCopiedWebhookEvent : WebhookEventBase
+{
+ public ContentCopiedWebhookEvent(
+ IWebhookFiringService webhookFiringService,
+ IWebhookService webhookService,
+ IOptionsMonitor webhookSettings,
+ IServerRoleAccessor serverRoleAccessor)
+ : base(
+ webhookFiringService,
+ webhookService,
+ webhookSettings,
+ serverRoleAccessor)
+ {
+ }
+
+ public override string Alias => Constants.WebhookEvents.Aliases.ContentCopied;
+
+ public override object? ConvertNotificationToRequestPayload(ContentCopiedNotification notification)
+ {
+ return new
+ {
+ notification.Copy,
+ notification.Original,
+ notification.ParentId,
+ notification.RelateToOriginal
+ };
+ }
+}
diff --git a/src/Umbraco.Core/Webhooks/Events/Content/ContentDeletedBlueprintWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentDeletedBlueprintWebhookEvent.cs
new file mode 100644
index 000000000000..996b8abd15d9
--- /dev/null
+++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentDeletedBlueprintWebhookEvent.cs
@@ -0,0 +1,32 @@
+using Microsoft.Extensions.Options;
+using Umbraco.Cms.Core.Configuration.Models;
+using Umbraco.Cms.Core.Models;
+using Umbraco.Cms.Core.Notifications;
+using Umbraco.Cms.Core.Services;
+using Umbraco.Cms.Core.Sync;
+
+namespace Umbraco.Cms.Core.Webhooks.Events.Content;
+
+[WebhookEvent("Content Template [Blueprint] Deleted", Constants.WebhookEvents.Types.Content)]
+public class ContentDeletedBlueprintWebhookEvent : WebhookEventContentBase
+{
+ public ContentDeletedBlueprintWebhookEvent(
+ IWebhookFiringService webhookFiringService,
+ IWebhookService webhookService,
+ IOptionsMonitor webhookSettings,
+ IServerRoleAccessor serverRoleAccessor)
+ : base(
+ webhookFiringService,
+ webhookService,
+ webhookSettings,
+ serverRoleAccessor)
+ {
+ }
+
+ public override string Alias => Constants.WebhookEvents.Aliases.ContentDeletedBlueprint;
+
+ protected override IEnumerable GetEntitiesFromNotification(ContentDeletedBlueprintNotification notification) =>
+ notification.DeletedBlueprints;
+
+ protected override object ConvertEntityToRequestPayload(IContent entity) => entity;
+}
diff --git a/src/Umbraco.Core/Webhooks/Events/Content/ContentDeletedVersionsWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentDeletedVersionsWebhookEvent.cs
new file mode 100644
index 000000000000..c543bfe3cad7
--- /dev/null
+++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentDeletedVersionsWebhookEvent.cs
@@ -0,0 +1,37 @@
+using Microsoft.Extensions.Options;
+using Umbraco.Cms.Core.Configuration.Models;
+using Umbraco.Cms.Core.Notifications;
+using Umbraco.Cms.Core.Services;
+using Umbraco.Cms.Core.Sync;
+
+namespace Umbraco.Cms.Core.Webhooks.Events.Content;
+
+[WebhookEvent("Content Versions Deleted", Constants.WebhookEvents.Types.Content)]
+public class ContentDeletedVersionsWebhookEvent : WebhookEventBase
+{
+ public ContentDeletedVersionsWebhookEvent(
+ IWebhookFiringService webhookFiringService,
+ IWebhookService webhookService,
+ IOptionsMonitor webhookSettings,
+ IServerRoleAccessor serverRoleAccessor)
+ : base(
+ webhookFiringService,
+ webhookService,
+ webhookSettings,
+ serverRoleAccessor)
+ {
+ }
+
+ public override string Alias => Constants.WebhookEvents.Aliases.ContentDeletedVersions;
+
+ public override object? ConvertNotificationToRequestPayload(ContentDeletedVersionsNotification notification)
+ {
+ return new
+ {
+ notification.Id,
+ notification.DeletePriorVersions,
+ notification.SpecificVersion,
+ notification.DateToRetain
+ };
+ }
+}
diff --git a/src/Umbraco.Core/Webhooks/Events/ContentDeleteWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentDeletedWebhookEvent.cs
similarity index 77%
rename from src/Umbraco.Core/Webhooks/Events/ContentDeleteWebhookEvent.cs
rename to src/Umbraco.Core/Webhooks/Events/Content/ContentDeletedWebhookEvent.cs
index 85a1f39ba9d4..128282299566 100644
--- a/src/Umbraco.Core/Webhooks/Events/ContentDeleteWebhookEvent.cs
+++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentDeletedWebhookEvent.cs
@@ -5,12 +5,12 @@
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Sync;
-namespace Umbraco.Cms.Core.Webhooks.Events;
+namespace Umbraco.Cms.Core.Webhooks.Events.Content;
-[WebhookEvent("Content was deleted", Constants.WebhookEvents.Types.Content)]
-public class ContentDeleteWebhookEvent : WebhookEventContentBase
+[WebhookEvent("Content Deleted", Constants.WebhookEvents.Types.Content)]
+public class ContentDeletedWebhookEvent : WebhookEventContentBase
{
- public ContentDeleteWebhookEvent(
+ public ContentDeletedWebhookEvent(
IWebhookFiringService webhookFiringService,
IWebhookService webhookService,
IOptionsMonitor webhookSettings,
diff --git a/src/Umbraco.Core/Webhooks/Events/Content/ContentEmptiedRecycleBinWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentEmptiedRecycleBinWebhookEvent.cs
new file mode 100644
index 000000000000..8670d23c49e5
--- /dev/null
+++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentEmptiedRecycleBinWebhookEvent.cs
@@ -0,0 +1,41 @@
+using Microsoft.Extensions.Options;
+using Umbraco.Cms.Core.Configuration.Models;
+using Umbraco.Cms.Core.DeliveryApi;
+using Umbraco.Cms.Core.Models;
+using Umbraco.Cms.Core.Notifications;
+using Umbraco.Cms.Core.PublishedCache;
+using Umbraco.Cms.Core.Services;
+using Umbraco.Cms.Core.Sync;
+
+namespace Umbraco.Cms.Core.Webhooks.Events.Content;
+
+[WebhookEvent("Content Recycle Bin Emptied", Constants.WebhookEvents.Types.Content)]
+public class ContentEmptiedRecycleBinWebhookEvent : WebhookEventContentBase
+{
+ private readonly IPublishedSnapshotAccessor _publishedSnapshotAccessor;
+ private readonly IApiContentBuilder _apiContentBuilder;
+
+ public ContentEmptiedRecycleBinWebhookEvent(
+ IWebhookFiringService webhookFiringService,
+ IWebhookService webhookService,
+ IOptionsMonitor webhookSettings,
+ IServerRoleAccessor serverRoleAccessor,
+ IPublishedSnapshotAccessor publishedSnapshotAccessor,
+ IApiContentBuilder apiContentBuilder)
+ : base(
+ webhookFiringService,
+ webhookService,
+ webhookSettings,
+ serverRoleAccessor)
+ {
+ _publishedSnapshotAccessor = publishedSnapshotAccessor;
+ _apiContentBuilder = apiContentBuilder;
+ }
+
+ public override string Alias => Constants.WebhookEvents.Aliases.ContentEmptiedRecycleBin;
+
+ protected override IEnumerable GetEntitiesFromNotification(ContentEmptiedRecycleBinNotification notification) =>
+ notification.DeletedEntities;
+
+ protected override object? ConvertEntityToRequestPayload(IContent entity) => entity;
+}
diff --git a/src/Umbraco.Core/Webhooks/Events/Content/ContentMovedToRecycleBinWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentMovedToRecycleBinWebhookEvent.cs
new file mode 100644
index 000000000000..6ed74d8c66e4
--- /dev/null
+++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentMovedToRecycleBinWebhookEvent.cs
@@ -0,0 +1,29 @@
+using Microsoft.Extensions.Options;
+using Umbraco.Cms.Core.Configuration.Models;
+using Umbraco.Cms.Core.Notifications;
+using Umbraco.Cms.Core.Services;
+using Umbraco.Cms.Core.Sync;
+
+namespace Umbraco.Cms.Core.Webhooks.Events.Content;
+
+[WebhookEvent("Content Moved to Recycle Bin", Constants.WebhookEvents.Types.Content)]
+public class ContentMovedToRecycleBinWebhookEvent : WebhookEventBase
+{
+ public ContentMovedToRecycleBinWebhookEvent(
+ IWebhookFiringService webhookFiringService,
+ IWebhookService webhookService,
+ IOptionsMonitor webhookSettings,
+ IServerRoleAccessor serverRoleAccessor)
+ : base(
+ webhookFiringService,
+ webhookService,
+ webhookSettings,
+ serverRoleAccessor)
+ {
+ }
+
+ public override string Alias => Constants.WebhookEvents.Aliases.ContentMovedToRecycleBin;
+
+ public override object? ConvertNotificationToRequestPayload(ContentMovedToRecycleBinNotification notification)
+ => notification.MoveInfoCollection;
+}
diff --git a/src/Umbraco.Core/Webhooks/Events/Content/ContentMovedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentMovedWebhookEvent.cs
new file mode 100644
index 000000000000..46d487c499e0
--- /dev/null
+++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentMovedWebhookEvent.cs
@@ -0,0 +1,29 @@
+using Microsoft.Extensions.Options;
+using Umbraco.Cms.Core.Configuration.Models;
+using Umbraco.Cms.Core.Notifications;
+using Umbraco.Cms.Core.Services;
+using Umbraco.Cms.Core.Sync;
+
+namespace Umbraco.Cms.Core.Webhooks.Events.Content;
+
+[WebhookEvent("Content Moved", Constants.WebhookEvents.Types.Content)]
+public class ContentMovedWebhookEvent : WebhookEventBase
+{
+ public ContentMovedWebhookEvent(
+ IWebhookFiringService webhookFiringService,
+ IWebhookService webhookService,
+ IOptionsMonitor webhookSettings,
+ IServerRoleAccessor serverRoleAccessor)
+ : base(
+ webhookFiringService,
+ webhookService,
+ webhookSettings,
+ serverRoleAccessor)
+ {
+ }
+
+ public override string Alias => Constants.WebhookEvents.Aliases.ContentMoved;
+
+ public override object? ConvertNotificationToRequestPayload(ContentMovedNotification notification)
+ => notification.MoveInfoCollection;
+}
diff --git a/src/Umbraco.Core/Webhooks/Events/ContentPublishWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentPublishedWebhookEvent.cs
similarity index 86%
rename from src/Umbraco.Core/Webhooks/Events/ContentPublishWebhookEvent.cs
rename to src/Umbraco.Core/Webhooks/Events/Content/ContentPublishedWebhookEvent.cs
index e1ba7125ec78..5847fb450e6c 100644
--- a/src/Umbraco.Core/Webhooks/Events/ContentPublishWebhookEvent.cs
+++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentPublishedWebhookEvent.cs
@@ -8,15 +8,15 @@
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Sync;
-namespace Umbraco.Cms.Core.Webhooks.Events;
+namespace Umbraco.Cms.Core.Webhooks.Events.Content;
-[WebhookEvent("Content was published", Constants.WebhookEvents.Types.Content)]
-public class ContentPublishWebhookEvent : WebhookEventContentBase
+[WebhookEvent("Content Published", Constants.WebhookEvents.Types.Content)]
+public class ContentPublishedWebhookEvent : WebhookEventContentBase
{
private readonly IPublishedSnapshotAccessor _publishedSnapshotAccessor;
private readonly IApiContentBuilder _apiContentBuilder;
- public ContentPublishWebhookEvent(
+ public ContentPublishedWebhookEvent(
IWebhookFiringService webhookFiringService,
IWebhookService webhookService,
IOptionsMonitor webhookSettings,
diff --git a/src/Umbraco.Core/Webhooks/Events/Content/ContentRolledBack.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentRolledBack.cs
new file mode 100644
index 000000000000..f38ff571f908
--- /dev/null
+++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentRolledBack.cs
@@ -0,0 +1,52 @@
+using Microsoft.Extensions.Options;
+using Umbraco.Cms.Core.Configuration.Models;
+using Umbraco.Cms.Core.DeliveryApi;
+using Umbraco.Cms.Core.Models;
+using Umbraco.Cms.Core.Models.PublishedContent;
+using Umbraco.Cms.Core.Notifications;
+using Umbraco.Cms.Core.PublishedCache;
+using Umbraco.Cms.Core.Services;
+using Umbraco.Cms.Core.Sync;
+
+namespace Umbraco.Cms.Core.Webhooks.Events.Content;
+
+[WebhookEvent("Content Rolled Back", Constants.WebhookEvents.Types.Content)]
+public class ContentRolledBackWebhookEvent : WebhookEventContentBase
+{
+ private readonly IPublishedSnapshotAccessor _publishedSnapshotAccessor;
+ private readonly IApiContentBuilder _apiContentBuilder;
+
+ public ContentRolledBackWebhookEvent(
+ IWebhookFiringService webhookFiringService,
+ IWebhookService webhookService,
+ IOptionsMonitor webhookSettings,
+ IServerRoleAccessor serverRoleAccessor,
+ IPublishedSnapshotAccessor publishedSnapshotAccessor,
+ IApiContentBuilder apiContentBuilder)
+ : base(
+ webhookFiringService,
+ webhookService,
+ webhookSettings,
+ serverRoleAccessor)
+ {
+ _publishedSnapshotAccessor = publishedSnapshotAccessor;
+ _apiContentBuilder = apiContentBuilder;
+ }
+
+ public override string Alias => Constants.WebhookEvents.Aliases.ContentRolledBack;
+
+ protected override IEnumerable GetEntitiesFromNotification(ContentRolledBackNotification notification) =>
+ new List { notification.Entity };
+
+ protected override object? ConvertEntityToRequestPayload(IContent entity)
+ {
+ if (_publishedSnapshotAccessor.TryGetPublishedSnapshot(out IPublishedSnapshot? publishedSnapshot) is false || publishedSnapshot!.Content is null)
+ {
+ return null;
+ }
+
+ // Get preview/saved version of content for a rollback
+ IPublishedContent? publishedContent = publishedSnapshot.Content.GetById(true, entity.Key);
+ return publishedContent is null ? null : _apiContentBuilder.Build(publishedContent);
+ }
+}
diff --git a/src/Umbraco.Core/Webhooks/Events/Content/ContentSavedBlueprintWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentSavedBlueprintWebhookEvent.cs
new file mode 100644
index 000000000000..40630b453f39
--- /dev/null
+++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentSavedBlueprintWebhookEvent.cs
@@ -0,0 +1,33 @@
+using Microsoft.Extensions.Options;
+using Umbraco.Cms.Core.Configuration.Models;
+using Umbraco.Cms.Core.Models;
+using Umbraco.Cms.Core.Notifications;
+using Umbraco.Cms.Core.Services;
+using Umbraco.Cms.Core.Sync;
+
+namespace Umbraco.Cms.Core.Webhooks.Events.Content;
+
+[WebhookEvent("Content Template [Blueprint] Saved", Constants.WebhookEvents.Types.Content)]
+public class ContentSavedBlueprintWebhookEvent : WebhookEventContentBase
+{
+ public ContentSavedBlueprintWebhookEvent(
+ IWebhookFiringService webhookFiringService,
+ IWebhookService webhookService,
+ IOptionsMonitor webhookSettings,
+ IServerRoleAccessor serverRoleAccessor)
+ : base(
+ webhookFiringService,
+ webhookService,
+ webhookSettings,
+ serverRoleAccessor)
+ {
+ }
+
+ public override string Alias => Constants.WebhookEvents.Aliases.ContentSavedBlueprint;
+
+ protected override IEnumerable
+ GetEntitiesFromNotification(ContentSavedBlueprintNotification notification)
+ => new List { notification.SavedBlueprint };
+
+ protected override object ConvertEntityToRequestPayload(IContent entity) => entity;
+}
diff --git a/src/Umbraco.Core/Webhooks/Events/Content/ContentSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentSavedWebhookEvent.cs
new file mode 100644
index 000000000000..fac16de822e5
--- /dev/null
+++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentSavedWebhookEvent.cs
@@ -0,0 +1,52 @@
+using Microsoft.Extensions.Options;
+using Umbraco.Cms.Core.Configuration.Models;
+using Umbraco.Cms.Core.DeliveryApi;
+using Umbraco.Cms.Core.Models;
+using Umbraco.Cms.Core.Models.PublishedContent;
+using Umbraco.Cms.Core.Notifications;
+using Umbraco.Cms.Core.PublishedCache;
+using Umbraco.Cms.Core.Services;
+using Umbraco.Cms.Core.Sync;
+
+namespace Umbraco.Cms.Core.Webhooks.Events.Content;
+
+[WebhookEvent("Content Saved", Constants.WebhookEvents.Types.Content)]
+public class ContentSavedWebhookEvent : WebhookEventContentBase
+{
+ private readonly IPublishedSnapshotAccessor _publishedSnapshotAccessor;
+ private readonly IApiContentBuilder _apiContentBuilder;
+
+ public ContentSavedWebhookEvent(
+ IWebhookFiringService webhookFiringService,
+ IWebhookService webhookService,
+ IOptionsMonitor webhookSettings,
+ IServerRoleAccessor serverRoleAccessor,
+ IPublishedSnapshotAccessor publishedSnapshotAccessor,
+ IApiContentBuilder apiContentBuilder)
+ : base(
+ webhookFiringService,
+ webhookService,
+ webhookSettings,
+ serverRoleAccessor)
+ {
+ _publishedSnapshotAccessor = publishedSnapshotAccessor;
+ _apiContentBuilder = apiContentBuilder;
+ }
+
+ public override string Alias => Constants.WebhookEvents.Aliases.ContentSaved;
+
+ protected override IEnumerable GetEntitiesFromNotification(ContentSavedNotification notification) =>
+ notification.SavedEntities;
+
+ protected override object? ConvertEntityToRequestPayload(IContent entity)
+ {
+ if (_publishedSnapshotAccessor.TryGetPublishedSnapshot(out IPublishedSnapshot? publishedSnapshot) is false || publishedSnapshot!.Content is null)
+ {
+ return null;
+ }
+
+ // Get preview/saved version of content
+ IPublishedContent? publishedContent = publishedSnapshot.Content.GetById(true, entity.Key);
+ return publishedContent is null ? null : _apiContentBuilder.Build(publishedContent);
+ }
+}
diff --git a/src/Umbraco.Core/Webhooks/Events/Content/ContentSortedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentSortedWebhookEvent.cs
new file mode 100644
index 000000000000..d2a95028e2fd
--- /dev/null
+++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentSortedWebhookEvent.cs
@@ -0,0 +1,53 @@
+using Microsoft.Extensions.Options;
+using Umbraco.Cms.Core.Configuration.Models;
+using Umbraco.Cms.Core.DeliveryApi;
+using Umbraco.Cms.Core.Models;
+using Umbraco.Cms.Core.Models.PublishedContent;
+using Umbraco.Cms.Core.Notifications;
+using Umbraco.Cms.Core.PublishedCache;
+using Umbraco.Cms.Core.Services;
+using Umbraco.Cms.Core.Sync;
+
+namespace Umbraco.Cms.Core.Webhooks.Events.Content;
+
+[WebhookEvent("Content Sorted", Constants.WebhookEvents.Types.Content)]
+public class ContentSortedWebhookEvent : WebhookEventBase
+{
+ private readonly IPublishedSnapshotAccessor _publishedSnapshotAccessor;
+ private readonly IApiContentBuilder _apiContentBuilder;
+
+ public ContentSortedWebhookEvent(
+ IWebhookFiringService webhookFiringService,
+ IWebhookService webhookService,
+ IOptionsMonitor webhookSettings,
+ IServerRoleAccessor serverRoleAccessor,
+ IPublishedSnapshotAccessor publishedSnapshotAccessor,
+ IApiContentBuilder apiContentBuilder)
+ : base(
+ webhookFiringService,
+ webhookService,
+ webhookSettings,
+ serverRoleAccessor)
+ {
+ _publishedSnapshotAccessor = publishedSnapshotAccessor;
+ _apiContentBuilder = apiContentBuilder;
+ }
+
+ public override string Alias => Constants.WebhookEvents.Aliases.ContentSorted;
+
+ public override object? ConvertNotificationToRequestPayload(ContentSortedNotification notification)
+ {
+ if (_publishedSnapshotAccessor.TryGetPublishedSnapshot(out IPublishedSnapshot? publishedSnapshot) is false || publishedSnapshot!.Content is null)
+ {
+ return null;
+ }
+ var sortedEntities = new List