Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Re-notify user of account in Drupal

When a user signs up at a Drupal site, there is a configurable message that Drupal will send the user letting them know their username and password.

I have about 1,000 users that I imported, but at the time, I didn't want to notify them - but now I do. Is there a way notify the users without reimporting them?

I looked through some of the modules I thought might contain that function, but I couldn't find it??

like image 933
tpow Avatar asked Feb 26 '10 15:02

tpow


People also ask

What is RSVP in Drupal?

The RSVP module lets users invite people by email to events and track a list of people who will be attending.

What is Form_state in Drupal?

$form_state['redirect'] The 'redirect' key controls what happens after a form's processing is complete. By default, the page with the form on it will reload, so the form's fields can be cleared out. If 'redirect' is set to a Drupal path (like user/edit), the user will be redirected to that path instead.

What is user management in Drupal?

User Management manages the information of the user, which allows creating or deleting the user, changing passwords, time and roles.


1 Answers

Of course there is a way: If you want to do this just one time, I recommend using a quick n' easy way... drupal_bootstrap(). In an external php file call this function to bootstrap Drupal, then load users and dispatch email messages. Here's a 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()
    // ...
}
// ...

Read more at Drupal API: drupal_mail() drupal_bootstrap().

like image 55
sepehr Avatar answered Oct 14 '22 06:10

sepehr