Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save greenhornet79/704585089be9316bae6f0978f4891ed9 to your computer and use it in GitHub Desktop.
Save greenhornet79/704585089be9316bae6f0978f4891ed9 to your computer and use it in GitHub Desktop.
<?php
add_action('leaky_paywall_update_subscriber', 'zeen_update_hubspot_after_sub_update', 10, 5);
function zeen_update_hubspot_after_sub_update($user_id, $email, $meta, $customer_id, $meta_args)
{
$data['properties']['firstname'] = $meta_args['first_name'];
$data['properties']['lastname'] = $meta_args['last_name'];
$data['properties']['level_id'] = $meta['level_id'];
$hubspot_id = get_user_meta($user_id, '_leaky_paywall_hubspot_id', true);
$api = new Leaky_Paywall_Hubspot_Api();
$api->update_contact($hubspot_id, $data);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment