I also tried using this hook
do_action( 'tml_user_activation_resend', $userid);
but still have no luck 🙁
Try this instead:
do_action( 'tml_new_user_registered', $userid, null, 'both' );
Hi Jeff,
Thanks for your reply, I tried just now this hook
do_action( 'tml_new_user_registered', $userid, null, 'both' );
But still doesnt work, I only get New User Email for reset password, but no Welcome Email (User Activation)
I didnt use any, custom redirect and use the custom email template with these variables:
User Activation: Activation Link: %activateurl%
New User: Reset URL: %reseturl%
Cheers,
Which moderation mode is selected?
How are you registering the user?
Hi Jeff, Thanks again. I registering the user like a subscribe, I choose E-mail only setting in TML General setting, and I request it using admin-ajax
this is my form
<form class="subscribe single">
<div class="input-group">
<input type="email" name="user_email" class="form-control" placeholder="Your business email address">
<span class="input-group-btn">
<button type="submit" class="btn btn-default pink btnSubscribe">Get Started!</button>
<?php wp_nonce_field( 'post_nonce', 'post_nonce_field' ); ?>
<input type="hidden" name="action" value="doRegister">
</span>
<span class="fa fa-times-circle" data-toggle="tooltip" data-placement="top" title=""></span><span class="fa fa-check-circle"></span>
</div>
</form>
and this is my ajax handler
$email = $_POST['user_email'];
if(!is_email($email)){
wp_send_json( array(
"success" => false,
"message" => "<strong>Ooops!</strong> It seems your email is not valid!."
));
}
if( email_exists( $email )) {
wp_send_json( array(
"success" => false,
"message" => "<strong>Ooops!</strong> Email address already exist!"
));
}
$password = wp_generate_password(12, true, false);
$newUser = array(
'user_pass' => $password,
'user_login' => $email,
'user_email' => $email,
'role' => 'pending'
);
$userid = wp_insert_user($newUser);
if ( ! is_wp_error( $userid ) ) {
do_action( 'tml_new_user_registered', $userid, null , 'both');
wp_send_json( array(
"success" => true,
"message" => "We’ve sent you an activation email. Please check your email and activate your account."
));
}else{
wp_send_json( array(
"success" => false,
"message" => "<strong>Sorry!</strong> We are having problem creating your account. Please try again later!"
));
}
Actually, as of 6.4.2, tml_new_user_registered is gone. Try this:
do_action( 'register_post' );
do_action( 'register_new_user', $userid );
Also, don’t set the role when you create the user, or the email isn’t sent. TML will set the role when the register_new_user action is called.
Hi Jeff Thanks for your reply,
Yeah it works now, when user register, it sent the Welcome email using User Activation template
User Activation: Activation Link: %activateurl%
but once user activated, it didnt send the email using New User template
New User: Reset URL: %reseturl%
it sent WP regular New User Registration email and WP Your username and password info Email instead
Cheers,
Ah, that would be a bug with 6.4.2. Since I changed the the action that applies the new user email filters to register_post, it no longer gets applied when a user activates or gets approved, because that action isn’t fired.
Looks like a 6.4.3 will be incoming…
Hi Jeff,
I have updated with the new version 6.4.3 and IT WORKS!!!
Thank you so much for your great plugin and support jeff
Cheers,