this should be ok, you could also use following code,
update_user_meta( $user_id, 'user_activation_status', 1 );
@hasanrang05 thanks for your answer, but I got a problem, if I change verification status via API, email about user success verification doesn’t send. Is there any ways to fix that?
@hasanrang05 I created my custom email sending when update user
for this in function.php I get plugin settings
$user_verification_settings = get_option('user_verification_settings');
$email_template = $user_verification_settings['email_templates_data']['email_resend_key'];
then I fill the email fields by info that I got from settings
$email_to = $user_data->email;
$email_bcc = isset($email_template['email_bcc']) ? $email_template['email_bcc'] : '';
$email_from = isset($email_template['email_from']) ? $email_template['email_from'] : get_option('admin_email');
$email_from_name = isset($email_template['email_from_name']) ? $email_template['email_from_name'] : get_bloginfo('name');
$reply_to = isset($email_template['reply_to']) ? $email_template['reply_to'] : get_option('admin_email');
$reply_to_name = isset($email_template['reply_to_name']) ? $email_template['reply_to_name'] : get_bloginfo('name');
$attachments = isset($email_template['attachments']) ? $email_template['attachments'] : '';
...
and in the end I send email via
$status = wp_mail($email_to, $subject, $email_body, $headers, $attachments);
That is correct way to fixing this issue?
-
This reply was modified 4 years, 11 months ago by
bodiashv.
-
This reply was modified 4 years, 11 months ago by
bodiashv.
@hasanrang05 thank you for your answers!)