• Resolved debinz

    (@debinz)


    Could I add a hook in my functions.php to send user name and email address to Zapier after approval?

    e.g. do you think would this work for WP Approve User? It works for another plugin that I’m not using

    function wpauSendWebhook( $user ) {
    $url = ‘https://zapier.com/hooks/catch/XXXXXXXX’;; // replace this with Zapier provided webhook URL

    $args = array(
    ‘method’ => ‘POST’,
    ‘body’ => array(
    ‘first_name’ => $user->user_firstname,
    ‘last_name’ => $user->user_lastname,
    ’email_address’ => $user->user_email,
    )
    );

    wp_remote_post( $url, $args );
    }

    add_action( ‘wpau_approve’, ‘wpauSendWebhook’, 10, 1 );

Viewing 1 replies (of 1 total)
  • Plugin Author Konstantin Obenland

    (@obenland)

    I don’t see why it shouldn’t work. Just be aware that wpau_approve passes the user ID and not a WP_User object.

    Konstantin

Viewing 1 replies (of 1 total)

The topic ‘Hook’ is closed to new replies.