Forums

Only fields with data in email template

lemair 29 Oct, 2013
Is there a way to only get the fields with data in to the email template?

So, if no data is entered in a field, it won't get into the email.
GreyHead 30 Oct, 2013
Hi lemair,

If you are using the ChronoForms generated template with a table layout then you can add some PHP to check.
<?php
if ( isset($form->data['input_name']) && $form->data['input_name'] ) {
  echo "<tr><td>Label</td><td>{$form->data['input_name']}</td></tr>";
}
?>

Bob
lemair 30 Oct, 2013
Thanks Bob, it worked!
This topic is locked and no more replies can be posted.