Untested - email to the password reset email.

This commit is contained in:
Robbie Antenesse 2015-12-02 17:25:06 -07:00
parent 7b7c0e9543
commit dadc4fba86
1 changed files with 14 additions and 1 deletions

View File

@ -6,7 +6,20 @@ function Set_Password_Reset($email) {
$reset = query($query); $reset = query($query);
if ($reset) { if ($reset) {
return true; $to = $email;
$subject = "Here's your Lexiconga password reset link";
$message = "Hello " . Get_Public_Name(Get_User_Id($email)) . "\n\nSomeone has requested a password reset link for your Lexiconga account. If it was you, you can reset your password by going to the link below and entering a new password for yourself:\n";
$message .= "http://lexicon.ga/?action=passwordreset&code=" . $reset_code . "\n\n";
$message .= "If it wasn't you who requested the link, you can ignore this email since it was only sent to you, but you might want to consider changing your password when you have a chance.\n\n";
$message .= "The password link will only be valid for today until you use it.\n\n";
$message .= "Thanks!\nThe Lexiconga Admins";
$header = "From: help@lexicon.ga\r\n";
if (mail($to, $subject, $message, $header)) {
return true;
} else {
return "could not send";
}
} else { } else {
return false; return false;
} }