catch email from user element.

afacuse

New Member
I have a user on a list item. and I need to send an email confirmation.
I could not see how I can access the user data.

Currently, a element calc take the user id, and a sql query look for the user's email.

I'm sure there's a more elegant way to solve email capture.

I welcome your comments!
thank you!
 
This way would still mean a query but is perhaps neater:

presuming your userid is in the variable $userid:
PHP:
$user = JFactory::getUser($userid);
$email = $user->get('email');
 
So you are using the standard form email plugin?

If so, in the "Email to (eval)", do basically what Rob did, but use a placeholder, so if the full element name for your user element is yourtable___userid:

PHP:
$user = JFactory::getUser('{yourtable___userid_raw}');
return $user->get('email');

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top