Last active
July 16, 2019 10:45
-
-
Save Pirenko/48335c4e3fd8a2b9991e73718d7cf975 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Set up e-mail feature | |
$to = 'hello@mail.com'; | |
$subject = 'Welcome to our website!'; | |
$headers = array('Content-Type: text/html; charset=UTF-8'); | |
// Get username secret key | |
$user_info = get_user_by('email', $to ); | |
$login_link='https://www.yourwebsite.com/wp-json/sand_login/prk_route?username='.$to.'&secret='.$user_info->secret_key; | |
// Create e-mail message | |
$body = 'Hello!<br />Click on the link below to login:<br /><a href="'.$login_link.'">Click here to login</a>'; | |
// Send e-mail | |
wp_mail( $to, $subject, $body, $headers ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment