A HubSpot form finisher that sends neos form builder forms to hubspot
This package provides a form finisher for neos form builder and a php service to send data to hubspot forms. Several forms with field mappings can be configured via settings and selected in the backend form finisher.
Versioning scheme:
1.0.0
| | |
| | Bugfix Releases (non breaking)
| Neos Compatibility Releases (non breaking except framework dependencies)
Feature Releases (breaking)
Releases und compatibility:
Package-Version | Neos CMS Version |
---|---|
1.0.x | 8.x |
Create API-Credentials in HubSpot and add them to neos settings:
FormatD:
HubSpot:
api:
portalId: 'my-hubspot-portal-id'
accessToken: 'my-secret-access-token'
The package comes with the following default mapping. This mapping can be modified or additional mappings can be configured. The objectTypeId is a sort of field-type defined by HubSpot.
FormatD:
HubSpot:
formFinisherMappings:
default:
firstname:
objectTypeId: '0-1'
name: 'firstname'
value: '${fieldValue}'
lastname:
objectTypeId: '0-1'
name: 'lastname'
value: '${fieldValue}'
company:
objectTypeId: '0-1'
name: 'company'
value: '${fieldValue}'
email:
objectTypeId: '0-1'
name: 'email'
value: '${fieldValue}'
phone:
objectTypeId: '0-1'
name: 'phone'
value: '${fieldValue}'
subject:
objectTypeId: '0-5'
name: 'subject'
value: "${'Request from ' + formValues.company}"
content:
objectTypeId: '0-5'
name: 'content'
value: '${fieldValue}'
Eel expressions can be used in the mapping configuration. These variables form the context can be used in these eel expressions per default: formValues
, fieldValue
.
If you need more your best bet would be to extend the finisher class and provide more context by overriding the collectMappingContextVariables()
method in the HubSpotFormFinisher class.
This way it would be possible to provide additional data form session or other sources.