Created
June 6, 2024 17:43
-
-
Save greenhornet79/704585089be9316bae6f0978f4891ed9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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