- Issue created by @mykola dolynskyi
- πΊπ¦Ukraine mykola dolynskyi Poltava
pushed the code to 3.x, tomorrow will test once again before merge request
When other Frontends are used, and Drupal is just backend, the pageUri, pageName, hutk and ipAddress should be properly passed as Frontend --> Drupal backend --> Hubspot API.
Which is not possible how.
Frontend should pass the values either in headers (recommended) either in submission body.
Headers are recommended, but will require to adjust CORS settings in services.yml to allow `hubspot-context` header.
In case if this not possible Frontend may pass values in request body as `hubspot_context` key. But in this way there is some complexity: hubspot cookie will be saved in submission by Webforms, which is not good. During submitting to hubspot API HubspotWebformHandler.php will unset `hubspot_context` from submission and resave it. This will trigger handlers again, HubspotWebformHandler will protect itself from double submitting to Hubspot API with static::$suppressResending, but not other handlers. If user don't want to remove `hubspot_context` and trigger double save, then set `dont_remove` property in request to non-falsy value.
In both cases (header `hubspot-context` or body `hubspot_context` passing) should be json encoded array - string. With keys pageUri, pageName, hutk, ipAddress, dont_remove - each is optional.
Before submitting HubspotWebformHandler will try to resolve hubspot context as first non-empty from:
- current request headers
- current request body
- saved submission body
and remove from submission body if present and `dont_remove` is not falsy
Accept and merge implementations by module owner.
None.
Handler can accept new data from header or body or submission body as described above.
none.
Soon I will add merge request with solution code.
Active
3.0
Code
pushed the code to 3.x, tomorrow will test once again before merge request