This is the code of my references-
function new_customer_registered_send_email_admin($customer_id)
{
$user = get_user_by( 'id', $customer_id );
$fullname = $order->get_billing_first_name()." ".$order->get_billing_last_name();
sendgrid_send_mail("{\"personalizations\":[{\"to\":[{\"email\":\"".$user->user_email."\",\"name\":\"".$fullname."\"}]}],\"from\":{\"email\":\"[email protected]\",\"name\":\"tellihealth\"},\"reply_to\":{\"email\":\"".$user->user_email."\",\"name\":\"".$fullname."\"},\"template_id\":\"d-d10a9fe177504e85a6c9bd297128477a\"}");
}
add_filter( 'woocommerce_login_redirect', 'my_login_redirect', 9999, 2 );
/**
* manage login redirection
*/
function my_login_redirect( $redirect, $user)
{
if(isset($_GET['checkout']) && $_GET['checkout'] =='true')
{
$redirect = home_url('/checkout');
}
return $redirect;
}