Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter olivier54

    (@olivier54)

    I use Authorizer 3.6.3.1

    I recieve notification e-mail, that is ok

    But i can’t write anything in textarea : What message should pending users see after attempting to log in ? and in textarea : What message should blocked users see after attempting to log in ?

    Thread Starter olivier54

    (@olivier54)

    https://portal.cran.univ-lorraine.fr/Capture%20d%E2%80%99%C3%A9cran%202023-09-23%20160114.jpg

    In the Login Access tab i select Administrator as in the linked image but no email is sent to me even though I am the site administrator, moreover in the part: What message should pending users see after attempting to log in? I can’t post a message I don’t have control as well as in the part: What message should blocked users see after attempting to log in? Is there an extension that is not compatible with my latest version of Authorizer?

    Thread Starter olivier54

    (@olivier54)

    HI,

    In fact I want to send an email to the site administrator each time a user has attempted to authenticate via CAS and is awaiting approval, as I am not in the pro version I program manually:
    add_action(‘authorizer_user_register’, ‘send_notification_on_pending_users’, 10, 1);

    // Function to send a notification to the administrator
    function send_notification_on_pending_users($user_data)
    {
    // Send email to admin for waiting user
    $to = ‘[email protected]’; // Administrator email address
    $subject = ‘New user waiting’;
    $message = ‘The user’ . $user_data[’email’] . ‘is awaiting approval.’;

     wp_mail($to, $subject, $message);

    }
    But the authorizer_user_register hook doesn’t exist in authorizer, so I don’t know which hook to use?

    Thread Starter olivier54

    (@olivier54)

    Hello,

    Thank you for your response. I understand that the issue may not be related to the $allow_login variable. However, I would like to clarify how I can detect users who are in “pending” status within the Authorizer plugin.

    I noticed the term “access_users_pending” in the code, but it doesn’t appear to be a standard WordPress hook. Could you please provide more details or guidance on how I can correctly detect users in “pending” status using Authorizer? Is there a specific hook or method that I should be using for this purpose?

    Your assistance in this matter would be greatly appreciated.

    Thank you.

    My code in function.php :

    // Ajoutez un hook sur l’action ‘authorizer_approval_pending’
    add_action(‘authorizer_approval_pending’, ‘notify_admin_on_approval_pending’, 10, 2);

    function notify_admin_on_approval_pending($user_id, $user_data) {
    // Envoyez un e-mail d’approbation ou de notification à l’administrateur
    $to = ‘[email protected]’; // Adresse e-mail de l’administrateur
    $subject = ‘Demande d\’approbation de connexion’;
    $message = ‘L\’utilisateur ‘ . $user_data[’email’] . ‘ a demandé une approbation de connexion.’;

    wp_mail($to, $subject, $message);
    }

    But authorizer_approval_pending does’nt exist ?

Viewing 4 replies - 1 through 4 (of 4 total)