• Resolved zagged

    (@zagged)


    Hi there, I don’t know if I have a unique situation or if anyone has attempted this before.

    UM version: 2.9.1
    WPForms version: 1.9.2.3 (their support suggested I reach out to UM for support for this issue)

    Scenario:
    A logged-in member/user is sending a referral to another member. The logged in user is viewing the profile page of the member they want to refer to, and I have a “Send a Referral” form (WPForms) embedded on the UM user page. The logged in member accesses the profile via the member directory.

    Problem:
    Using?{user_email}?or similar “user” tags in the WPForms field (default value) retrieves the email address of the?logged-in user. However, my goal is to retrieve the email address of the?profile user?(the member whose profile is being viewed). The WPForms smart tags do not have a “{profile_email}” tag that I’m aware of or a way to fetch any data from a “profiled” user.

    Goal:
    When the logged-in user submits the referral form, I need the form to dynamically retrieve the email address (or other meta data) of the profiled user. This is essential so I can set up a notification to send to the profiled user as well as ensure the data mapped to my ACF is correct. I don’t want to rely on the logged in user to enter the profiled user data properly b/c they potentially will not.

    Is what I’m attempting to achieve even possible? If so, do you have any suggestions?

    Thanks for your assistance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support yuriinalivaiko

    (@yuriinalivaiko)

    Hello @zagged

    You have to add your own custom smart tags like the {profile_email} tag. I’m not familiar with WPForms, but I think there is a hook that allows adding custom tags. Look at the WPForms documentation.

    You can use the um_user function to get the profile owner data inside the profile. Use um_user( 'user_email' ); to get the profile owner email address.

    Regards

    Thread Starter zagged

    (@zagged)

    Thank you @yuriinalivaiko this was helpful. WPForms did suggest the custom smart tag option as well but I just didn’t quite ‘get it’. One small adjustment though – the um_user brought in the logged in user details, not the profiled user details so I used um_fetch_user() this did the trick.

    Thanks for responding, much appreciated.

    Plugin Support yuriinalivaiko

    (@yuriinalivaiko)

    Hello @zagged

    You said that you want to add custom functionality to the profile. The um_user function returns the profile owner data inside the profile. This function returns the current user data outside the profile.

    Please do not use the um_fetch_user() function unless absolutely necessary, because it changes the user globally. Note that you must restore a user after using the um_fetch_user() function.

    Regards

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