• Is there a way to generate an Approve / Reject link in the Admin Notification email? We’d like to have moderators review and approve users without granting full WordPress admin privileges. Email approval capabilities might be one way, but also open to other ideas as well. Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Mirza Hamza

    (@hamza1010)

    Hello @stewarttodd,

    Thanks for contacting us,

    I hope you are doing well, We have to check this and we will keep you updated on this.

    Thanks & Regards
    WP Experts Support Team

    Plugin Support Mirza Hamza

    (@hamza1010)

    Hello @stewarttodd,

    Please try this code on your site and let us know if you still have any issues, we hope this snippet of code will fulfill your need.

    Here is the code:

      add_filter('new_user_approve_request_approval_message', 'nua_update_status_by_email', 10, 3);

    function nua_update_status_by_email($message, $user_login, $user_email) {

    $user = get_user_by('email', $user_email);
    $user_id = $user->ID;
    $nonce = wp_create_nonce('nua_update_user');
    $approve_link = add_query_arg(array('user-action'=>'approved', 'user-id' => $user_id, 'nonce' => $nonce ), site_url());
    $approve_link = sprintf(__('Approve : %s','new-user-approve' ), $approve_link );
    $deny_link = add_query_arg( array('user-action'=>'denied', 'user-id' => $user_id, 'nonce' => $nonce ) , site_url());
    $deny_link = sprintf(__('Deny : %s','new-user-approve' ), $deny_link );
    $message.='</br>';
    $message.=$approve_link;
    $message.='</br>';
    $message.=$deny_link;
    return $message;

    }


    add_action('init', 'approve_deny_user');

    function approve_deny_user() {

    if( isset( $_GET['user-action']) && isset($_GET['user-id'])) {

    $status = $_GET['user-action'];
    $user_id = $_GET['user-id'];
    update_user_meta($user_id, 'pw_user_status', $status);

    }

    }

    If you have any questions, feel free to reach out. We’re here to assist you.

    Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.