Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: ListMessenger (or PHPlist) integration – plugin?


peterverkooijen
Participant

@peterverkooijen

I’m now trying to add firstname, lastname and email address straight to the database tables of my mailing list. I’ve added the queries to the function I had put together here:

function synchro_wp_usermeta($user_id, $password, $meta) {
global $bp, $wpdb;

...

$wpdb->query("INSERT mailingusers SET users_id='$user_id', group_id='1', signup_date= UNIX_TIMESTAMP(), firstname= '$firstname', lastname= '$lastname', email_address= '$user_email'");
$wpdb->query("INSERT mailingcdata SET cdata_id=NULL, user_id='$user_id', cfield_id='1', value='$company'");

}
add_action( 'wpmu_activate_user', 'synchro_wp_usermeta', 10, 3);

This mostly works, except the for the email address. $firstname, $lastname and $user_id are all correctly added to the table, but the email_address field stays empty.

Can anyone spot the problem?

How can I “call” the user’s email address upon ‘wpmu_activate_user’?

Adding a $user_email argument only produces missing argument errors. I’m out of guesses…

$current_user->user_email doesn’t work either:

$wpdb->query("INSERT mailingusers SET users_id='$user_id', group_id='1', signup_date= UNIX_TIMESTAMP(), firstname= '$firstname', lastname= '$lastname', email_address= '$current_user->user_email'");

Skip to toolbar