Email only fields that have been filled out?

timwatson 19 Sep, 2008
Is it possible to have the email notification only send the results of the fields that were actually filled out and not the fields that were left empty on the form?

Thanks,
Tim
Max_admin 19 Sep, 2008
Hi Tim,

you will need PHP for every field in the email then, and you will an email template to do this, let me know if you are interested and I can show some example.

Regards

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
timwatson 19 Sep, 2008
Thank you...I am interested and would love to see some examples of how to do this.

Thank you!
Tim
Max_admin 20 Sep, 2008
Hi Tim,

Assuming you have a field called "field_1" for example, to include it in the template you add this :

field_1 : {field_1}

to switch it on or off base on if its empty or not, you should use something like this :

<?php if(JRequest::getVar('field_1')){ ?>
field_1 : {field_1}
<?php } ?>


thats it, do this for every field!

Regards

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
timwatson 25 Sep, 2008
Where do I include that PHP code, in the email template code? When I try copy and pasting that into the Email Template code I get an error that says:
Fatal error: Class 'JRequest' not found in /home/logochai/public_html/components/com_chronocontact/chronocontact.php(327) : eval()'d code on line 3

Am I putting that code in the wrong place?
Max_admin 25 Sep, 2008
Hi Tim, try adding at the top :

<?php global $mainframe; ?>

you have J1.5 and CF V3.0 stable, correct ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
timwatson 25 Sep, 2008
Sorry, no, I should have mentioned that. I am running Joomla! 1.0.14 RC1 Stable [ Daybreak ]. Chrono Forms version 2.3.9
Max_admin 25 Sep, 2008
ok, my code will be :

if($_POST['field_1']){
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.