views:

27

answers:

2

I need to send registration details somewhere else when Drupal completes a registration. I can't find the correct variables for the switch. I tried this but it's not working. This function is in my module "externalnewsletter".

function externalnewsletter_user($op, &$edit, &$account, $category = NULL) {
    if ($op == 'register' && $category == 'submit') {
        // do stuff...
    }
}

thanks

+1  A: 

You can use Drupal 6's Triggers and Actions to set this up without much coding. First create an action, this is where you can put your custom code if you like. Then you can go to Administer | Site Building | Triggers, and in the Users tab you will find a trigger for account creation.

There is a guide for writing actions here: http://drupal.org/node/172152

alxp
A: 

I figured it out. I needed to look for the "insert" like this:

function externalnewsletter_user($op, &$edit, &$account, $category = NULL) {

     // user registration ---------------------->
     if ($op == 'insert') {
         // do stuff...

     }

}

The problem now is I need the password they entered unencrypted BEFORE Drupal uses MD5. And I need all the other $_POST vars because I added a few fields to the user profiles. When I print_r($_POST); it just prints "1". How do I get the $_POST vars or somehow get all the other vars from the form?

thanks

EricP