kooogi
Forum Replies Created
-
Okey, finnaly its work, imo. You are amazing. Ty one more time.
Ty, a lot <3
add_action('um_account_pre_update_profile', 'send_custom_email_on_profile_change', 10, 2); function send_custom_email_on_profile_change($changes, $user_id) { $data = get_userdata($user_id); if (isset($changes['user_email']) && $data->user_email != $changes['user_email']) { $new_email = $changes['user_email']; $old_email = $data->user_email; // Load the template file $template_path = UM()->files()->plugin . 'ultimate-member/email/'; $email_content = file_get_contents($template_path . 'changedaccount_email.php'); // Replace placeholders with actual content $email_content = str_replace('{{new_email}}', $new_email, $email_content); $email_content = str_replace('{{old_email}}', $old_email, $email_content); // Send the email $to = array($new_email, $old_email); $subject = 'Zmiana adresu e-mail w profilu'; $headers = array('Content-Type: text/html; charset=UTF-8'); wp_mail($to, $subject, $email_content, $headers); } }
I tried smth like this but it doesnt work
Now i feel kinda blind. However thank You very much.
add_action( 'um_submit_form_errors_hook__registration', 'my_submit_form_errors_hook__registration', 10, 2 ); function my_submit_form_errors_hook__registration( $submitted_data, $form_data ) { if ( isset( $args['user_login'] ) ) { if ( isset( UM()->form()->errors['user_login'] ) ) { unset( UM()->form()->errors['user_login'] ); } if ( empty( $args['user_login'] ) ) { UM()->form()->add_error( 'user_login', __( 'Enter username', 'ultimate-member' ) ); } elseif ( username_exists( $args['user_login']) ) { UM()->form()->add_error( 'user_login', __( 'The username already taken', 'ultimate-member' ) ); } } }
I tried smth like this but its doesnt work
- This reply was modified 1 year, 3 months ago by kooogi.
OMG, how did I miss it. Ty a lot
By the way do U have any idea how to custom error message in register form with username (user_login) field, coz there’s only “no validation” or “unique check”, cant select custom validation
Now even if a username/email exists its callback an error that the user doesnt exist
Unfortunately nothing change, its looks like “um_reset_password_errors_hook” doesnt works too. And the second thing i cant set custom validation on user_login, there’s only “no validation” or “unique check”.
Thanks @wpmudevsupport12 for replying.
I have one more question, coz i use ACF and is it any plugin to allow user to edit their data that is in ACF