Make notification service able to handle segmented content #20160
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prerequisites
If there's an existing issue for this PR then this fixes #20045
Description
See the linked issue for a description.
Testing this PR
You'll need to be able to receive notification emails from Umbraco. An easy way to do that is to configure the SMTP options to use the
SpecifiedPickupDirectory
inappsettings.json
:You'll also need to enable segments for document types. This code snippet should do the trick in V13:
With all that in place, create a new doctype with "Allow segmentation" enabled:
Note that you don't actually need any segmented properties to test this PR 😄
Now create a document of the segmented doctype, and sign up for any notification for that document. I've used the "Update" notification for testing, because it's easy to trigger.
When this is in place, trigger the notification (e.g. save the document again if you're using the "Update" notifcation).
Without this PR, the
NotSupportedException
fromNotificationService
bubbles all the way into the UI:With this PR, the notification email should be sent (or generated on disk, if you configured
SpecifiedPickupDirectory
).