• Resolved firefighter

    (@huntersbest)


    Since the end of April / beginning of May, the site admin does not receive emails when a new user registers on the frontend of the site.

    All other emails to users are sent correctly – so no problem with sending.

    Does that maybe have to do with the update in April, 24th about not sending mails to admin if registering in the backend?

    Email settings are checked for admin email, as she has to approve registration. Has anyone encountered this behaviour and how did you correct this?

    um-actions-register.php line 116

    function um_send_registration_notification( $user_id )

    if ( is_admin() ) – if this redirects to an endpoint – user will always be admin….. so no email will be sent to admin even when the registration happens in the frontend.

    • This topic was modified 5 months, 2 weeks ago by firefighter. Reason: file and line found in plugin
Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter firefighter

    (@huntersbest)

    um-actions-register.php line 116 stopps sending Emails to admin if User registers on Frontend. Sorry but true.

    tested: removed if (is_admin()) part: Mail is sent

    tested: changed admin email with if condition (just in case something was wrong with the emailadress) – not working

    So please remove the bug.

    Plugin Author Mykyta Synelnikov

    (@nsinelnikov)

    Hi @huntersbest

    Sorry for the delayed reply and thanks for the reporting and patience.

    Probably we need to make more debugging on your side.
    Conditional Tags – Theme Handbook | Developer.WordPress.org based on the official WordPress docs is_admin() condition works (quals true) only for wp-admin screens.

    Please, could you clarify what do you mean by frontend on your installation and what do you mean by endpoint in the line below:

    if this redirects to an endpoint – user will always be admin

    Probably do you use some 3rd-party integration e.g. REST API or some requests that can trigger is_admin() condition? If you have some custom endpoint redirects, could you make them later?

    Action: um_registration_complete – Ultimate Member Hook Docs
    um_send_registration_notification callback has 10 priority;
    um_check_user_status callback (with Ultimate Member built-in redirects based on User Roles settings) has 100 priority;

    In the custom redirects cases it’s possible to use 11 priority and redirect user to endpoint after email sending callback.

    It works properly for standard WordPress installations where frontend it’s a Registration page, but is_admin() triggers when User has been added via wp-admin/user-new.php by Administrator.

    Please let me know,
    Best Regards!

    Thread Starter firefighter

    (@huntersbest)

    Thank you for coming back to me.

    We use Ninja Forms with User Management Addon for the registration form. This has worked so far out of the box by setting up users and the approval for the registration and all further handling of users and restrictions was done via Ultimate Member Plugin.

    If I read your answer right – this creating of users via Ninja Forms causes now causes them to be “created by Administrator”.

    Plugin Author Mykyta Synelnikov

    (@nsinelnikov)

    Hi @huntersbest

    Thanks for prompt clarifying and letting us know.

    For some reason yes. And it also triggers hooks related only for sending wp-admin/user-new.php.
    https://github.com/ultimatemember/ultimatemember/blob/a0162b1a4cf0dfec763369d03037bc14718a36b5/includes/core/class-user.php#L965
    Here we check is_admin() also during wp_insert_user function hook’s ‘user_register’ callback.

    Could you also ask Ninja Forms team about is_admin() condition during the registration form submission? I think their dev team knows better about submission process of their forms.

    I also created the PR with the possible fix and avoid using the is_admin() in our callbacks, but looks like for your case it’s not a solution.
    https://github.com/ultimatemember/ultimatemember/pull/1711

    Anyway if you can check it and how it works on your installation, will be great.

    P.S. Is it possible to use Ultimate Member Registration forms for you or there are some issues you have faced during setup?

    I’ll be in touch,
    Best Regards!

    Thread Starter firefighter

    (@huntersbest)

    Hello and sorry for coming back so late.

    I tried your branch, and – as you expected – this does not work in our case.
    We used Ninja Forms because of Design prerequisites that could not be managed with your plugin unfortunately. But we will use a workaround for the admin email with Ninja Forms – redirecting to the approval page of your plugin.
    And – hopefully in the future we will change the registration form to your plugin.

    Thank you very much for your patience and help.

    Plugin Support yuriinalivaiko

    (@yuriinalivaiko)

    Hi @huntersbest

    This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.

    Please feel free to re-open this thread if any other questions come up and we’d be happy to help. 🙂

    Regards

    Thread Starter firefighter

    (@huntersbest)

    Sorry, I totally forgot to answer, because with your help we used the Ninja Workaround. Still – great plugin and helpful support

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

You must be logged in to reply to this topic.