Skip to content

Instantly share code, notes, and snippets.

@shrop
Created February 6, 2017 21:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shrop/31edc1fbe4f62d4637b02da9da65f9b4 to your computer and use it in GitHub Desktop.
Save shrop/31edc1fbe4f62d4637b02da9da65f9b4 to your computer and use it in GitHub Desktop.
Send Drupal 7 Password Reset Email
<?php
// Array of user IDs to email.
$uids = array('1');
// Loop through array of uids and attempt to send password reset emails.
foreach ($uids as $uid) {
// Load a user.
$account = user_load($uid);
// Invoke the email. It will be queued along with other system mail to be sent during cron
_user_mail_notify('password_reset', $account);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment