Register a user from email.
-
Hello,
We are trying to create a new registered user from the postie sender email address but without success.
Can somebody have a look at this code and make any suggestions ?<?php function my_postie_post_function($post) { //do something here like update $post['post_content'] add_filter('postie_filter_email', 'my_filterEmail'); function my_filterEmail($email) { //create the user function my_postie_post_function($post) { //do something here like update $post['post_content'] add_filter('postie_filter_email', 'my_filterEmail'); function my_filterEmail($email) { //create the user $user_id = username_exists( $user_name ); if ( !$user_id and email_exists($user_email) == false ) { $random_password = wp_generate_password( $length=12, $include_standard_special_chars=false ); $user_id = wp_create_user( $user_name, $random_password, $user_email ); } else { $random_password = __('User already exists. Password inherited.'); } return $email; } return $post; } add_filter('postie_post_before', 'my_postie_post_function'); } return $post; } add_filter('postie_post_before', 'my_postie_post_function'); ?>
Thanks
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Register a user from email.’ is closed to new replies.