Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action('user_register', 'send_new_user', 10, 1);
- function send_new_user ($user_id){
- $new_user = get_userdata($user_id);
- $useremail = $new_user -> user_email;
- $url = 'https://api.capsulecrm.com/api/v2/parties';
- $body = array(
- 'firstName' => 'WhyWontYouWork',
- 'email' => $useremail
- );
- $args = array(
- 'method' => 'POST',
- 'timeout' => 45,
- 'redirection' => 5,
- 'httpversion' => '1.0',
- 'sslverify' => false,
- 'blocking' => false,
- 'headers' => array(
- 'Authorization' => 'Bearer {private token goes here!!!!}',
- 'Content-Type' => 'application/json',
- 'Accept' => 'application/json',
- ),
- 'body' => json_encode($body),
- 'cookies' => array()
- );
- $request = wp_remote_post ($url, $args);
- };
Add Comment
Please, Sign In to add comment