Hook
-
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 );
The topic ‘Hook’ is closed to new replies.