-
- $email_tpl = load_view_file("view/passchanged_eml.tpl");
- $email_tpl = replace_macros($email_tpl, array(
- '$sitename' => $a->config['sitename'],
- '$siteurl' => $a->get_baseurl(),
- '$username' => $username,
- '$email' => $email,
- '$new_password' => $new_password,
- '$uid' => $newuid ));
-
- $res = mail($email,"Your password has changed at {$a->config['sitename']}",$email_tpl,"From: Administrator@{$_SERVER[SERVER_NAME]}");
+ ));
+ info("Your password has been reset." . EOL);
+
+
+ $sitename = $a->config['sitename'];
+ $siteurl = $a->get_baseurl();
+ // $username, $email, $new_password
+ $preamble = deindent(t('
+ Dear %1$s,
+ Your password has been changed as requested. Please retain this
+ information for your records (or change your password immediately to
+ something that you will remember).
+ '));
+ $body = deindent(t('
+ Your login details are as follows:
+
+ Site Location: %1$s
+ Login Name: %2$s
+ Password: %3$s
+
+ You may change that password from your account settings page after logging in.
+ '));
+
+ $preamble = sprintf($preamble, $username);
+ $body = sprintf($body, $siteurl, $email, $new_password);
+
+ notification(array(
+ 'type' => "SYSTEM_EMAIL",
+ 'to_email' => $email,
+ 'subject'=> sprintf( t('Your password has been changed at %s'),$sitename),
+ 'preamble'=> $preamble,
+ 'body' => $body));