Implement HubSpot: Extend the forms widget designer to check for data submission to HubSpot
NOTE: This step is optional.
In some cases, you may want to enable content editors to reuse the same Sitefinity CMS forms on different pages and sync data to different connectors. For example, a form may be configured to send data to HubSpot but on a particular page but on another page you may want to send data to a different platform, for example, Eloqua.
To do so:
- Create a new class that inherits the FormsConnectorDesignerExtender.
Name the new class HubSpotFormsConnectorDesignerExtender.
- Implement the Title property and set the value to the title of the new tab that will be displayed in the Forms designer widget, for example, HubSpot.
NOTE: The title can be localizable.
- Implement the Name property to set the value of the unique name that the new extender has.
NOTE: The name is not localizable and is used in the code to differentiate different Forms widget designer extenders.
- Implement the GetProperties method to specify the list of properties in the custom designer tab.
In this tutorial, this is a single Boolean property signaling whether the data submitted for the specific form on the current page is sent to HubSpot.
- Type represents the field type.
- Name represents the unique name with which the field is used in the code.
- Title represents the localizable title of the field.
- Text represents the localizable label of the text field.
EXAMPLE: For more information, see HubSpotFormsConnectorDesignerExtender
class from the downloaded sample.
-
Register the new class in ObjectFactory.
You do this in the initialization logic of the HubSpot module:
ObjectFactory.Container.RegisterType<ConnectorDataMappingExtender, HubSpotConnectorDataMappingExtender>("HubSpot");