Forums

email for upload with username

creositi 14 Aug, 2014
I created a file upload form for registered users only. Can I put in the email confirming the upload email and the username user?And I can send you a confirmation email taking the email address directly from the data with which you registered?
creositi 14 Aug, 2014
Oh no, it's not what I need .... :-D
creositi 16 Aug, 2014
Thanks for the guide.
I have been following what is written in the guide but I guess I did something wrong because it does not work.

The form is to upload the file. When he gets the email confirmation of the upload must be written at the bottom:
LOADED USER: username
EMAIL ADDRESS: user email

I plugged in EVENTS a CUSTOM CODE in ON SUBMIT
How MODE I left CONTROLLER, and I have entered the code
<?php
$user =& JFactory::getUser();
?>

After that there is UPLOAD FILE (which works perfectly)

After there is EMAIL
Here I have configured all the mail (that comes). In the template I added this line at the bottom
$form->data['user_email'] = $user->email;

Where did I go wrong? Because when I receive the e-mail administrator, the last line is written just
$form->data['user_email'] = $user->email;
GreyHead 17 Aug, 2014
Answer
Hi Creositi,

You need all the PHP in the Custom Code event. Only the $form->data array entries are saved for use in other actions.
<?php
$user =& JFactory::getUser();
$form->data['user_email'] = $user->email;
?>
Then use user_email in the Email Dynamic To box; and/or {user_email} in the email template.

Bob.
creositi 17 Aug, 2014
Perfect, I solved it.
Sorry but I do not speak English and then translate the tutorials with google translate and not always quite understand what is written.

Thank you!
This topic is locked and no more replies can be posted.