Published 18th of dec 2019
Episerver Forms 2-5
After a visitor submits a form, Forms.Core calls Actors to perform additional processing on the server.
By default, Episerver Forms has two built-in Actors:
A WebHook is a simple event notification via HTTP POST; when a WebHook event is triggered, a HTTP POST request is sent to a URL.
Episerver Forms has built-in WebHooks with the CallWebhookAfterSubmissionActor. As a publisher of the event, WebHooks pushes all form data to the remote URL.
By default, the Form Step Action Element sends away a webhook action for every step.
Check the IsFinalized flag by overriding the CallWebhookAfterSubmissionActor. Code below only allows webhooks when forms are finalized.
public class CustomActorsExecutingService : EPiServer.Forms.Core.PostSubmissionActor.ActorsExecutingService
public override IEnumerable<IPostSubmissionActor> GetFormSubmissionActors(Submission submission, FormContainerBlock formContainer, FormIdentity formIden, HttpRequestBase request, HttpResponseBase response, bool isFormFinalizedSubmission)
var actors = base.GetFormSubmissionActors(submission, formContainer, formIden, request, response, isFormFinalizedSubmission);
return actors; //return all
return actors.Where(a => !(a is CallWebhookAfterSubmissionActor));//do not return the webhook actor
And … register the custom actor
private static void ConfigureContainer(StructureMap.ConfigurationExpression container)
About the author
– Independent Senior Web Developer
working with Azure and Episerver