Notify user again about Drupal account

When a user logs in to the Drupal website, there is a custom message that Drupal will send to the user, telling him his username and password.

I have about 1000 users that I imported, but at that time I did not want to notify them, but now I do it. Is there a way to notify users without renaming them?

I looked through some of the modules that I thought might contain this function, but I could not find them

+6
php email drupal drupal-6
source share
1 answer

Of course, there is a way: if you want to do this just once, I recommend using a quick, easy way ... drupal_bootstrap() . In an external php file, call this function to download Drupal, then load users and send emails. Here's the pseudo code:

 <?php // ... // Change directory to Drupal root chdir(../../); // Bootstrap Drupal require './includes/bootstrap.inc'; // You might want to pass DRUPAL_BOOTSTRAP_DATABASE instead drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); $db_result = db_query('SELECT * FROM {users}'); while ($user_object = db_fetch_object($db_result)) { // TODO: Use drupal_mail() to send desired emails // User Name: $user_object->name // User Email: $user_object->email // Don't forget to pass 'em through the check_plain() // ... } // ... 

More about the Drupal API: drupal_mail() drupal_bootstrap() .

+2
source share

All Articles