Add support for customizable Webhook Payload Providers #20627
Replies: 1 comment 1 reply
-
|
Hey @erikjanwestendorp, thank you for reaching out. The current way of changing a webhookevent's payload is to replace the webhookevent with a custom one. See: https://docs.umbraco.com/umbraco-cms/reference/webhooks#replacing-webhook-events. Your solution seems to shift the responsibility of building that payload to another class that is in a one on one relation with the webhookevent. If there is none present then it would run the payload creation logic on the webhookevent itself. Looking at the code and the implementation example you provided, it seems to me that you need the following two things:
Both of these should be able to be included in a non breaking way. Please let me know if this would cover your needs and I will take your updated proposal to the team. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently the webhook system allows you to configure webhooks for specific events and add headers. However, for many integrations you may need to customise what is sent in the webhook payload (for example, selecting specific properties, formatting differently, injecting additional metadata, etc).
I’ve been playing with the idea of making this possible using Webhook Payload Providers. These providers should make it possible to override the default webhook payload. I’ve just created a draft PR to demonstrate how it works. I’m curious to hear if this is something that could be added?
Of course, there are a few things to take into account:
WebhookPayloadProviderCollection.WebhookEventContentBase,WebhookEventBase), this could be done in a cleaner way.An example of how this could work:
Beta Was this translation helpful? Give feedback.
All reactions