I want to send a link in email body where user can click on this to use the Login with Google functionality.
i am using this simple link
$client_id ='xxxxxxxxxxxxxxxxxx';
$client_secret = 'xxxxxxxxxxxxxxxxxx';
$redirect_uri ='xxxxxxxxxxxxxxxxxx';
$google_link='accounts.google.com/o/oauth2/auth?response_type=code&redirect_uri='.$site_url.'&client_id='.$client_id.'&scope=email+profile&access_type=online&approval_prompt=auto';
$html.='<div>
<a href="'.$google_link.'">Click here</a>
</div>
';
wp_mail( $email_address,subject, $html, $headers);
But it gives me this error:
The session state () didn't match the state parameter (1843962623)
Question: How to send this link (Login with Google) in email body to user, upon which clicking it redirect the user to my website? And how this state parameter works?