Page 1 of 1

[solved] Passing Variables from Frontend Users to UDTs

Posted: Fri Feb 12, 2010 5:13 pm
by turch2009
I need to retrieve the $email variable from Frontend Users for a UDT.  UDT's don't seem to like the Smarty Functions given in the FUE module help page, but I'm not very well-versed as to how to use these.  Can soomeone please show me what I should put in the UDT to grab the variable?

Re: Passing Variables from Frontend Users to UDTs

Posted: Tue Feb 16, 2010 4:27 am
by jmcgin51
what does your UDT look like right now?

To pull the variable from FEU, the UDT will need to have something like this:

global $gCms;
$email = $gCms->smarty->get_template_vars('feu_email');  //or whatever the actual feu email property name is

Re: Passing Variables from Frontend Users to UDTs

Posted: Tue Feb 16, 2010 5:52 am
by turch2009
ok, so this is the UDT I put in not making a change to your addition:

global $gCms;
$email = $gCms->smarty->get_template_vars('feu_email');

mail('$email','Application Approved','Your Application has been approved.');

I know that $email is the FEU variable used to get the user's email.  I'm not sure how to put that here.  This currently doesn't work.  If I replace "$email" with my email, it does mail when it's supposed to, so I know I have it set up in the Events manager correctly.

Re:Passing Variables from Frontend Users to UDTs

Posted: Wed Feb 17, 2010 2:14 pm
by jmcgin51
is "feu_email" the actual name of the email field in FEU?  Check {get_template_vars}.

Re: Passing Variables from Frontend Users to UDTs

Posted: Wed Feb 17, 2010 2:59 pm
by turch2009
The email field in FEU is $email

Re: Passing Variables from Frontend Users to UDTs

Posted: Wed Feb 17, 2010 3:15 pm
by jmcgin51
then you need to change your UDT

try
global $gCms;
$email = $gCms->smarty->get_template_vars('email');

mail('$email','Application Approved','Your Application has been approved.');

Re: Passing Variables from Frontend Users to UDTs

Posted: Wed Feb 17, 2010 8:58 pm
by turch2009
That didn't work unfortunately.  I then tried this:

global $gCms;
$email = $gCms->smarty->get_template_vars('email');

mail('myemail@yahoo.com','Application Approved','Your Application has been approved $email.');


I got the email and it said "Your Application has been approved $email."  I expected it to show the variable but I guess not.

Any other ideas?

Re: Passing Variables from Frontend Users to UDTs

Posted: Wed Feb 17, 2010 11:34 pm
by turch2009
Ok, I got the solution through working out with a friend.  Here it is and it works for anyone else trying to do this:

$extravar = $_REQUEST["m1_input_email"];

mail($extravar,'Profile Updated','Your profile has been updated');


Thanks for everyone's help!