A form picker and rendering component for HubSpot forms using two authentication methods: API Key and OAuth.
To use an API key, the following app setting will need to be added to `Web.config`:
<add key="Umbraco.Cms.Integrations.Crm.Hubspot.ApiKey" value="[your API key]" />
The key will be added to all requests made to the HubSpot API and used to authenticate access.
If you prefer not to use an API key, an authentication flow using OAuth is also available. To use this, simply ensure you don't have an API key in your configuration file.
To support multi-region HubSpot forms, the following app setting is needed in `Web.config`:
<add key="Umbraco.cms.Integrations.Crm.Hubspot.Region" value="[region]" />
For example, forms hosted in EU will use the `eu1` setting.
Backoffice usage
To use the form picker, a new data type should be created based on the HubSpot Form Picker property editor.
Depending on the configuration, a message will be prompted.
If OAuth is being used for authentication, then the Connect button will be enabled and trigger the authorization workflow. The access token will be saved into the database and used for future requests.
Revoke action will remove the access token from the database.
Front-end rendering
A strongly typed model will be generated by the property value converter and an HTML helper is available to easily render the form on the front-end.
Ensure your template has a reference to the following using statement:
@using Umbraco.Cms.Integrations.Hubspot.Helpers;
and render the form using (assuming a property based on the created type, with alias `hubspotForm` has been created):
@Html.RenderHubspotForm(Model.hubspotForm)