Disable webhooks on #Episerver forms if not finalized

How to override the default actor to disable none finalized forms to be sent.

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:

  • CallWebhookAfterSubmissionActor
  • SendEmailAfterSubmissionActor

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.

Problem
By default, the Form Step Action Element sends away a webhook action for every step.

Solution
Check the IsFinalized flag by overriding the CallWebhookAfterSubmissionActor. Code below only allows webhooks when forms are finalized.

And … register the custom actor

 

Read more:

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

 

Like it? please up vote
1

Leave a Reply

Your email address will not be published. Required fields are marked *