After user enter email and password. hook_user_login gets triggered and excute below code. I am placing code in "bootstap_business.theme" file like this
function hook_user_login($account) {
$email = $account->geteMail();
echo "Email: $email";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://example.com/users" );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt($ch, CURLOPT_POST, 1 );
curl_setopt($ch, CURLOPT_POSTFIELDS, "$email" );
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/plain','Authorization: ff23fdcffdgh5dsdsds'));
$result=curl_exec ($ch);
}
But i am not getting whether this function is excuted or not. How can i debug/solve this problem. If i do echo also its not printing anything.