The service hooks in Sitefinity provide a powerful and easy mechanism for creating custom connectors that can update external systems when an event occurs in Sitefinity. For example, you can create a HubSpot contact when a user logs in Sitefinity. To do that you need to create custom triggers and custom actions for the service hooks.
You can register your own triggers and actions. They should be registered in custom Sitefinity modules as shown in the sample below. For more information, see Custom modules.
To register a trigger, you need to implement IServiceHookTriggerProvider interface in your module. You also need to create a new trigger class that inherits from ServiceHookTriggerSettingsBase.
When defining trigger settings, you need to add this data in constructor:
To register custom actions, you must implement IServiceHookActionProvider interface in your module. In addition, you need to create new action setting class that inherits from IServiceHookActionSettings or the built-in WebhookActionSettings
When defining action setting you need to
To complete the action, you must implement the ExecuteActionAsync method as shown in the sample
Finally, you need to register the trigger and the action in a Sitefinity module:
After you have implemented and registered your custom action and trigger you are ready to configure your first service hook using the new connector.
By providing a value for the ParemtersType in the trigger and in the action you can easily build custom UI for your connectors. But if the built-in functionalities are not enough you can customize the fields in the create/edit screen using the Admin App extensions. Learn more about custom fields in GitHub.
Sign up for our free beginner training. Boost your credentials through advanced courses and certification. Register for Sitefinity training and certification.
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important