-
-
Save signalpoint/f17c645e44b9379d8320 to your computer and use it in GitHub Desktop.
Drupal - resend welcome e-mails on users administration form.
This file contains hidden or 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
<?php | |
/** | |
* Implements hook_user_operations(). | |
*/ | |
function example_user_operations() { | |
$operations = array( | |
'example_resend_welcome_email' => array( | |
'label' => t('Re-send welcome e-mail'), | |
'callback' => 'example_resend_welcome_email', | |
) | |
); | |
return $operations; | |
} | |
/** | |
* | |
*/ | |
function example_resend_welcome_email($accounts) { | |
$accounts = user_load_multiple($accounts); | |
foreach ($accounts as $account) { | |
watchdog('example', 'Re-sent welcome e-mail to %mail.', array('%mail' => $account->mail)); | |
drupal_set_message(t('Re-sent welcome e-mail to %mail', array('%mail' => $account->mail))); | |
$op = 'register_admin_created'; // @see https://api.drupal.org/api/drupal/modules!user!user.module/function/_user_mail_notify/7 | |
_user_mail_notify($op, $account); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment