Profile plugin

patopaiar 21 Aug, 2009
If you could please help me, I need a detailed step-by-step description of how to use the Profile Plugin in order to add the username to the form each time it sends an email?

Than you very much in advanc
GreyHead 22 Aug, 2009
HI patopaiar,

You don't need the Profile Plugin to use the User name, you can get that from the Joomal User Object. Add a hidden field and code snippet to your form like this
<?php
$user =& JFactory::getUser();
?>
<input type ='hidden' name='user_name' value='<?php echo $user->name; ?>' />
Then you can use {user_name} in your email template.

Bob
patopaiar 22 Aug, 2009
Thank you very much for your help Bob.

I understood the instructions perfectly, allow me to bother you a bit more.
I´m wondering where should I add this code:

1. in mail.php?
2. In the mail´s own text? (step 3 of the Wizord Editor)
3. somewhere else?

Thank you very much for your time
GreyHead 22 Aug, 2009
Hi patopaiar,

That code needs to go into the Form HTML. Then you can use {user_name} in your Email Template.

Bob
patopaiar 22 Aug, 2009
Thanks to your invaluable help, its finally worked !!

May I ask you one more question:

Is it possible to automatically include a .doc or .pdf file within the mails body ?
I need to put a .doc .pdf or .txt file. as the mail´s text.

Thank again for your great help

Pat
GreyHead 23 Aug, 2009
Hi patopaiar,

A text file, Yes; a PDF file, No; a DOC file, Maybe.

I don't think that you can actually use a doc file, but you could save a doc file as html and use that. (Though Word generated HTML is full of junk code and might make an enormous email.)

Bob
patopaiar 23 Aug, 2009
Hi Bob,

Yes, you are right it makes not sense a doc or pdf.

I´d like open a .txt, put it in the previuos form, and after the user edit the content, to save it in the same file.

Do I have to change the code or there is another way to do it ?

Thank´s again for your help

Pat
This topic is locked and no more replies can be posted.