Published 18th of March 2020
Episerver.CMS 11, Forms v4
In an InitializationModule:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
public void Initialize(InitializationEngine context) { IContentEvents events = ServiceLocator.Current.GetInstance<IContentEvents>(); events.CreatingContent += SetWebhookOnForms; } private void SetWebhookOnForms(object sender, ContentEventArgs e) { //getting webhookurl from appsettings var webhookurl = ConfigurationManager.AppSettings["Webhook:forms"] + ""; if (!String.IsNullOrEmpty(webhookurl) && e.Content is FormContainerBlock formContainerBlock) { List<WebhookActorModel> webhookActorModels = formContainerBlock.Content.Property.GetPropertyValue<IEnumerable<WebhookActorModel>>("CallWebhookAfterSubmissionActor").ToList(); var customWebhook = new List<CallWebhookAfterSubmissionActor>(); if (webhookActorModels == null || webhookActorModels.Count() == 0) { webhookActorModels.Add(new WebhookActorModel { BaseUrl = webhookurl, PostDataInJsonFormat = true } ); } formContainerBlock.Content.SetPropertyValue("CallWebhookAfterSubmissionActor", webhookActorModels); } } |
There you got it, self explanatory

Search terms
- Episerver Forms webhooks add on publish
- Webhooks on all forms programmatically
- Automatic webhook on episerver forms
About the author
Luc Gosso
– Independent Senior Web Developer
working with Azure and Episerver
Twitter: @LucGosso
LinkedIn: linkedin.com/in/luc-gosso/
Github: github.com/lucgosso