aicomp
Forum Replies Created
-
Forum: Plugins
In reply to: [Advanced Custom Fields (ACF?)] Archive Slug not workingCan anybody help here please?
Ah, got it. Thanks, I’ll try that.
Hi Tino,
The meta keys are all identical with the ones in the automation for logged-in users submitting the form.
And the post with the title will be generated with the automation. But the following meta data will not be generated. But only in the anonymous submission. Same action with same data but in anonymous scenario the meta data stays empty what you can also see in the logs.
So my question here is: What’s the technical difference here between the logged-in and anonymous scenario and why should the additional plugin would make sense if it all works well in the scenario for logged-in users submitting the form?
Thanks
Hi,
Thank you. It works great. One question: The code in the functions.php can be deleted as the plugin now provides the functionality, right?
As an additional information: The logs to each automation look good. Just the result doesn’t happen
My forms have different names to their IDs. Might that cause a conflict? Or any caching plugin?
Sorry, it worked for one automation cycle and then stopped again. The two automations with the Elementor form don’t work. All other automations work as expected.
Any idea?
I’ll ask again before we misunderstand each other. Sorry, if you already understood my issue ??
As far as I know, text messages were not really a problem here. The problem is that by clicking the confirmation link in the first email (double option), the user already has direct access to the website. But actually, he/she should only get access when I manually approve them afterwards.
So from the process: User registers -> gets double optin email -> clicks link in email -> I see that he/she has clicked the DOI and can approve him -> user gets email that he is approved -> account status Approved
The bold part is now missing but worked in the past.
Thank you
okay…my fault. I found the error. As I left the “user” field empty to assign the automation to every user who send the form, the automation really starts only 1 time even if different users send the form. So, Times per user must be 0.
All of that is not part of the issue. The automation worked in the past with the same form and we tested with a fresh user.
The code snippet worked in the past. It was needed that the user has to confirm the initial registration (double opt-in). After that the user gets an email being informed that I (admin) will review the registration (registration pending – approval needed). After given approval the user gets a final confirmation of being successfully registered.
The rest of the code relies on better usability for the user informing if an email address (user) is already registered. This works as expected.
Now, the manual admin approval step doesn’t work anymore. After the registration the user clicks the confirmation email link and will be redirected to the profile. With that the registration is approved automatically. But I need the manual approval step back.
See the code below. Unfortunately, the changes didn’t work. I also cleared the cache afterwards.
add_action( 'um_after_email_confirmation', 'um_after_email_confirmation_admin_approval', 10, 1 );
function um_after_email_confirmation_admin_approval( $user_id ) {
um_fetch_user( $user_id );
UM()->common()->users()->set_as_pending( $user_id, $force );
}
add_action( 'um_submit_form_errors_hook_logincheck', 'my_submit_form_errors_hook_logincheck', 10, 1 );
function my_submit_form_errors_hook_logincheck( $args ) {
$user_id = ( isset( UM()->login()->auth_id ) ) ? UM()->login()->auth_id : '';
um_fetch_user( $user_id );
$status = um_user( 'account_status' );
if( $status == 'awaiting_email_confirmation' ) {
UM()->common()->users()->set_as_pending( $user_id, $force );
um_reset_user();
exit( wp_redirect( add_query_arg( 'err', esc_attr( 'awaiting_new_email_confirmation' ), UM()->permalinks()->get_current_url() ) ) );
}
}
add_filter( 'um_custom_error_message_handler', 'my_custom_error_message_handler', 999, 2 );
function my_custom_error_message_handler( $err, $error ) {
if( $error == 'awaiting_new_email_confirmation' ) {
return __( 'Your account is awaiting e-mail verification and we have now sent you a new e-mail for verification.', 'ultimate-member' );
} else {
return $err;
}
}
/**
* Custom validation and error message for the E-mail Address field.
*/
add_action( 'um_custom_field_validation_user_email_details', 'um_custom_validate_user_email_details', 999, 3 );
function um_custom_validate_user_email_details( $key, $array, $args ) {
if ( $key == 'user_email' && isset( $args['user_email'] ) ) {
if ( isset( UM()->form()->errors['user_email'] ) ) {
unset( UM()->form()->errors['user_email'] );
}
if ( empty( $args['user_email'] ) ) {
UM()->form()->add_error( 'user_email', __( 'E-mail Address is required', 'ultimate-member' ) );
} elseif ( ! is_email( $args['user_email'] ) ) {
UM()->form()->add_error( 'user_email', __( 'The email you entered is invalid', 'ultimate-member' ) );
} elseif ( email_exists( $args['user_email'] ) ) {
UM()->form()->add_error( 'user_email', __( 'The email you entered is already registered', 'ultimate-member' ) );
}
}
}
/**
* Doubled validation and error message for the E-mail Address field.
*/
add_action( 'um_submit_form_errors_hook', 'confirm_user_email_textbox', 100, 1 );
function confirm_user_email_textbox( $args ){
if ( isset( $args['user_email'] ) && isset( $args['confirm_user_email'] ) && $args['confirm_user_email'] != $args['user_email'] ) {
UM()->form()->add_error( 'user_email', 'Your email addresses are different' );
UM()->form()->add_error( 'confirm_user_email', 'Your email addresses are different' );
}
}Thank you. That’s exactly what I was looking for.
Got it…Thanks for your support.