Capture User Email as parameter

  • John Willems
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
3 years 2 months ago #140522 by John Willems
Capture User Email as parameter was created by John Willems
Sadly I am not a PHP developer, I work in the .Net world,  so I have a question. I have a need to capture the user email from membership pro when they login. I need for that email address to be passed as parameter to another site in html query string. 

So if I login to membership I need to get my email address from mempro (joomla) and pass it as a parameter in the query. All of that is simple except capuring the email address. It is in the manage account section of the site but how to read it escapes me. 

Any Membership Pro/PHP/Joomla developers out there that can get me pointedin the correct direction? I appreciate any help.

Thanks
John W

Please Log in or Create an account to join the conversation.

More
3 years 2 months ago #140542 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Capture User Email as parameter
Hello John

Not sure how you would handle it but to get email of logged in user, it is really simple:
Code:
$user = JFactory::getUser(); echo $user->email;

Tuan

Please Log in or Create an account to join the conversation.

  • John Willems
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
3 years 2 months ago #140564 by John Willems
Replied by John Willems on topic Capture User Email as parameter
Tuan - thanks I start working with this. What I need to do is get it from the code above to a html/url link on the page. So when the user goes from Membership Pro to my application site they are identified as valid.

If I can get it and pass it, I will have done a major improvement to overall functionality. Sometimes it is the small things that matter.

Please Log in or Create an account to join the conversation.

More
3 years 2 months ago #140570 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Capture User Email as parameter
Hello John

It's hard to answer this question as I don't know how users go from Membership Pro to your application

And exactly what is your application? Is it part of Joomla or it is something outside Joomla?

Tuan

Please Log in or Create an account to join the conversation.

  • John Willems
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
3 years 2 months ago #140580 by John Willems
Replied by John Willems on topic Capture User Email as parameter
It is needed as a value to pass outside of the Joomla app. Here is a sample
href="http://solomonappraisal.com?CMD=xxx"

I need to replace the xxx with the user email. The link is on a Joomla article page. When I put the code sample in you provided earlier it comments it out. I have tried all kinds of tags to show it is php code, but it does not seem to recognize it. The page shows as index.php in the browser window. So that tells me it is a php page and not a html page. It should be working but is not, so I am missing something.

Please Log in or Create an account to join the conversation.

More
3 years 2 months ago #140583 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Capture User Email as parameter
Hello John

In this case, maybe you can go to Extensions -> Plugins, find and enable the plugin Content - Membership Tags

Then you can use

Please Log in or Create an account to join the conversation.

  • John Willems
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
3 years 2 months ago #140584 by John Willems
Replied by John Willems on topic Capture User Email as parameter
Tuan

Thanks! I am off to try that. It will be really nice if I can get this to work. I can use it in the log in code process with the other app. The ultimate goal is check their users plan type which I believe is done by plan_id.

The desired result is that I will be able to turn off or on features in the non-Joomla app, based on their subscription type.

Please Log in or Create an account to join the conversation.

  • John Willems
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
3 years 2 months ago #140585 by John Willems
Replied by John Willems on topic Capture User Email as parameter
The tag works to show the mail on the page. So its further than I have been. Now to wrap it in the href. If that works, I will do a happy dance.

As always, thanks for the great support.

Please Log in or Create an account to join the conversation.

More
3 years 2 months ago #140590 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Capture User Email as parameter
You can put the tag into the link, it will be replaced with the actual email and solve your issue.

Regards,

Tuan

Please Log in or Create an account to join the conversation.