In the User module you can filter users by roles. When setting Logintoboggan to use a pre-auth role, it's easy to filter out who hasn't verified their account yet, and there's the dropdown menu of actions you can take when selecting multiple users (or all of them). It would be a very useful feature to add to that list of actions, the ability to re-send validation links to all selected users.

I'm not sure if it's easy to hook into that dropdown menu via another module, or if the User module needs hacking, but everything is already there, so it seems like a pretty fast/easy feature to add?

Comments

AppleBag’s picture

Well, I got a little impatient and whipped up a little code myself to do this. It appears to work fine, however, I haven't fully tested it yet, so a confirmation would be nice. It may also need a little tweaking/making more robust if desired.

Just add the following code to the logintoboggan module:

/**
 * Implementation of hook_user_operations().
 */
 function logintoboggan_user_operations() {
 
   $operations = array(
    'resend' => array(
      'label' => t('Re-send Registration Validation to the selected users'),
      'callback' => 'logintoboggan_mass_resend_validations',
    ),
  );
  
  return $operations;
 }

/**
 * Callback function for admin mass resending validation to users.
 */
	function logintoboggan_mass_resend_validations($accounts) {
	
  foreach ($accounts as $uid) {
  
    $account = user_load(array('uid' => (int)$uid));

	  // Variables to replace in e-mail
	  $pass = t('If required, you may reset your password from: !url', array('!url' => url('user/password', NULL, NULL, TRUE)));
	  $variables = array('!username' => $account->name, '!site' => variable_get('site_name', 'drupal'), '!password' => $pass, '!uri' => $base_url, '!uri_brief' => substr($base_url, strlen(_logintoboggan_protocol() .'://')), '!mailto' => $account->mail, '!date' => format_date(time()), '!login_uri' => url('user', NULL, NULL, TRUE), '!edit_uri' => url('user/'. $account->uid .'/edit', NULL, NULL, TRUE), '!login_url' => logintoboggan_eml_validate_url($account));
	
	  // Prepare and send e-mail.
	  $from = variable_get('site_mail', ini_get('sendmail_from'));
	  $subject = _user_mail_text('welcome_subject', $variables);
	  $body = _user_mail_text('welcome_body', $variables);
	  drupal_mail('logintoboggan-resend-validation', $account->mail, $subject, $body, $from);
	
	  // Notify admin that e-mail was sent
		watchdog('LoginToboggan', "A validation e-mail has been re-sent to " . $account->name . "'s e-mail address.", WATCHDOG_NOTICE);
  }
}
AppleBag’s picture

Status: Active » Needs review
hunmonk’s picture

Version: 5.x-1.6 » 7.x-1.x-dev
Status: Needs review » Needs work

i won't accept new features on the 5.x or 6.x branch -- for consideration, this patch need to be:

a) in an actual patch
b) updated for 7.x

AppleBag’s picture

Fair enough. I won't be installing 7 until it's official release, so if you want to update it yourself, have at it. It seems to be working great on my 5x.

YK85’s picture

subscribing

Bilmar’s picture

subscribing

hunmonk’s picture

please see http://drupal.org/project/logintoboggan#commitment for more information on how task/feature requests are handled in the module

Gabriel R.’s picture

I am working on this for Drupal 6, it will be a separate module depending on Drupal Queue and Loggin Toboggan. Stay tuned.

marcusx’s picture

Any news on this?

@Gabriel Radic: Any chnace you could post your Queue D6 solution in a sandbox?

marcusx’s picture

As a workaround you can use http://drupal.org/project/account_reminder it adds an option to admin/people to resend a reminder mail. Even if you don't use the autoreminder function.

It still might not be the perfect solution if you have a lot of users as you need to check all users on all pages if the email needs to go to everybody.

stevecowie’s picture

Another approach would be to do this with actions, which I quite like as I'm not sure that mass send fits with the core of LT is doing: making adjustments to core's login behaviour. I think @marcusx approach is also an acceptable workaround.