• Resolved jayme2604

    (@jayme2604)


    Hello Ultimate Member Support,

    When an user updates their profile form, I would like to let Ultimate Member send an email to only the admin. For that, I have added a Snippet with your code: https://github.com/MissVeronica/UM-Admin-User-Profile-Update-Email/blob/main/source.php. If I go to Ultimate Member email settings, I do see the template appearing “Profile is updated email”, but it’s not working.

    A second question, when updating the profile form, the user will be redirecting back to the homepage. But I would like to let the user stay on the same tab, on the same page. I have already checked user management, but I can’t set a manual redirect link in there.

    Hopefully you can help me out here with above 2 questions.

    Thanks again!

Viewing 15 replies - 1 through 15 (of 20 total)
  • @jayme2604

    1. You can remove the current code snippet and keep the email template.

    Install this new plugin instead for the Admin email when a User is updated.

    https://github.com/MissVeronica/um-admin-user-profile-update-email

    2. The default is to return to the User Profile page after a profile edit.
    How did you setup the General Pages Tab

    https://docs.ultimatemember.com/article/38-pages-tab

    Thread Starter jayme2604

    (@jayme2604)

    @missveronicatv,

    1. That’s done. I have removed the snippet and installed the plugin. Unfortunately, it does not seem to work when I update the profile. Haven’t recieved any email on my admin account.
    2. The “User Page” under “General” was referring to a concept page as I don’t want members to access their profile. Now, I have published this page and when I update the profile it redirects the user to the user page. That’s fine, but as it is a tab, I want to redirect it back to that same tab. If that’s not possible, then a redirect back to “Account” is also fine. I just prefer giving feedback to the user that the request has been received etc. Was hoping to pass a custom redirect link, to any page.

    The tab setup I have done through Ultimate Member, with another plugin: https://github.com/umdevelopera/um-account-tabs. In there I have created a tab, then added under “Pre-defined content” the profile form from Ultimate Member.

    Plugin Support Yurii

    (@yuriinalivaiko)

    Hello @jayme2604

    The plugin always redirects to the User page (view mode) after updating the profile form. There is no setting to change this. You can use the um_update_profile_redirect_after hook in your custom code to change the redirect URL after updating the profile form. Try the code below. You can add this code snippet to the functions.php file in your active theme directory.

    // Redirect to the same page after updating the profile form.
    add_filter( 'um_update_profile_redirect_after', function( $url, $user_id, $args ) {
    	$current_url = UM()->permalinks()->get_current_url();
    	return remove_query_arg( 'um_action', $current_url );
    }, 10, 3 );

    Regards

    Thread Starter jayme2604

    (@jayme2604)

    @yuriinalivaiko Thanks, that works! 🙂

    @missveronicatv Could you please take a look at number 1? I don’t receive emails when an user updates their profile.

    @jayme2604

    Yes you are right and Profile updates via the User Account page tabs
    are not supported in the current Plugin version.

    Thread Starter jayme2604

    (@jayme2604)

    @missveronicatv

    Oh, is there an alternative method to accomplish this using a code snippet? This form holds significant importance as it will act as a membership change request. Without the admin receiving these requests, the form will be basically meaningless.

    Thread Starter jayme2604

    (@jayme2604)

    @missveronicatv

    Wait a second, it appears I am receiving emails. Let me double check a couple things.

    @jayme2604

    Have you tried with an update of the Form as the Profile User page?

    Thread Starter jayme2604

    (@jayme2604)

    @missveronicatv

    I actually do receive emails, so that is working, but there is a problem. The subject is coming through, but the content of the email is empty. When I navigate to the email template and I save something like text and I navigate back again to the email template, then it’s empty again.

    @jayme2604

    OK, sounds like a permission issue at your active theme’s ultimate-member/email/ folder. Your customized email template can’t be saved by UM Settings -> Email.

    https://docs.ultimatemember.com/article/1335-email-templates

    Thread Starter jayme2604

    (@jayme2604)

    @missveronicatv

    I have granted the Ultimate Member folder under themes 774 rights, but still no luck. Do I need to make a separate file?

    @jayme2604

    Yes you need a template file from the Plugin installation folder.

    Copy the plugin email template file from:
    ...plugins/um-admin-user-profile-update-email-main/profile_is_updated_email.php

    to your active theme’s or child-theme’s directory:
    .../ultimate-member/email/profile_is_updated_email.php

    Thread Starter jayme2604

    (@jayme2604)

    @missveronicatv

    I don’t have a folder called “profile_is_updated_email” in “plugins/um-admin-user-profile-update-email-main” nor the file called like that. Do I need to copy the “changedaccount_email.php” from “plugins/ultimate-member/templates/email”?

    • This reply was modified 2 years, 10 months ago by jayme2604.

    @jayme2604

    Try this updated plugin which will try to install your email template also.

    https://github.com/MissVeronica/um-admin-user-profile-update-email

    Thread Starter jayme2604

    (@jayme2604)

    @missveronicatv

    I have installed the plugin, it’s strange. The content is still not getting saved. Also when I check in FTP, no file has been created.

Viewing 15 replies - 1 through 15 (of 20 total)

The topic ‘Profile form email to admin’ is closed to new replies.