Hey there, @greenrooster, thank you for reaching out.
I was wondering if a table would be a good way of presenting this information? If so, I have found a snippet we created a while back which does exaclty that, it adds the {all_fileds} in a table.
Please create a new MU plugin file like
wp-content/mu-plugins/forminator-email-table-view.php
(just create the /mu-plugins/ folder if it doesn’t exist already)
and insert in there the exact snippet:
<?php
add_filter( 'forminator_get_formatted_form_entry', function( $html, $custom_form, $data, $entry, $ignored_field_types ){
$ignored_field_types = Forminator_Form_Entry_Model::ignored_fields();
$form_fields = $custom_form->get_fields();
$table_rows = array();
if ( is_null( $form_fields ) ) {
$form_fields = array();
}
foreach ( $form_fields as $form_field ) {
$field_type = $form_field->__get( 'type' );
if ( in_array( $field_type, $ignored_field_types, true ) ) {
continue;
}
$label = $form_field->get_label_for_entry();
$value = render_entry( $entry, $form_field->slug );
$table_rows[ $label ] = $value;
}
$table_head = array_keys( $table_rows );
$table_body = array_values( $table_rows );
array_walk( $table_head, function( &$content, $key ) {
$content = "<th><strong>{$content}</strong></th>";
});
array_walk( $table_body, function( &$content, $key ) {
$content = "<td>{$content}</td>";
});
$html = '<table>';
$html .= "<tr>";
$html .= "<thead>" . implode( '', $table_head ) ."</thead>";
$html .= "<tr>";
$html .= "<tr>";
$html .= "<tbody>" . implode( '', $table_body ) ."</tbody>";
$html .= "<tr>";
$html .= '</table>';
return $html;
}, 20, 5 );
Let us know how it goes.
Regards,
Jorge