Hi. Hubspot have a way to change how data arrives?
Just like Zapier it let user send any JSON data?
If not, you must edit the output data.
It’s not hard. Just use our hooks.
As we merge data from special mail tags and contact form you can empty the first using ctz_get_data_from_special_mail_tags (or just do not add any Special Mail Tag option) and change data from ctz_get_data_from_contact_form.
This way:
add_filter( 'ctz_get_data_from_contact_form', 'sharktank_add_data_to_zapier', 10, 2 );
function sharktank_add_data_to_zapier( $data, $contact_form ) {
/**
* Example from Hubspot "Create a New Subscription":
* { "subscriptionDetails" : { "subscriptionType" : "company.propertyChange", "propertyName" : "companyname" }, "enabled" : false }
*
* @link https://developers.hubspot.com/docs/methods/webhooks/webhooks-overview
*/
$data = array(
'subscriptionDetails' => array(
'subscriptionType' => 'company.propertyChange',
'propertyName' => 'companyname',
'anyProFromForm' => $data['field-name'],
'anyOtherPropFromForm' => $data['other-field-name'],
),
'enabled' => false,
);
return $data;
}
Do not forget to add validations and so on…