Hello,
Thanks for the feedback. There’s no conditional template tag available right now. You can create your own output tho, and use it in an “E-mail Action”.
To do so, create a new “Custom Action”, right before the “E-mail” action. Let’s call it “email-output”. Use the custom code in the “Advanced Tab” to create your own query_var
which will output exactly the fields you want. In your case, something like this:
add_action('acfe/form/submit/email-output', 'my_form_email_output', 10, 2);
function my_form_email_output($form, $post_id){
// Start buffer
ob_start();
?>
<?php
// Retrive my_field user input
if(get_field('my_field')){ ?>
Field: <?php echo get_field('my_field'); ?><br />
<?php } ?>
<?php
// Retrive my_field_2 user input
if(get_field('my_field_2')){ ?>
Field 2: <?php echo get_field('my_field_2'); ?><br />
<?php } ?>
...
<?php
// Retrieve buffer
$output = ob_get_clean();
// Set Query var to be used in a latter action using {query_var:email-output}
set_query_var('email-output', $output);
}
As you can see, in the action I use set_query_var()
function to set the data I want to display. Then in the “E-mail Action” I retrieve it using {query_var:email-output}
.
See screenshot: https://i.imgur.com/j99gI8m.png
Hope it helps!
Regards.