Hi @capo123,
To display labels for empty fields in notifications, you can use the following custom code:
/**
* Filters dashes from labels on plain text email.
*
* @link
*
* @param string $message Confirmation message including Smart Tags.
* @param array $emails
* @return array
*/
function wpf_dev_email_message( $message, $emails ) {
// Remove dashes from labels
$email = str_replace( array( '--- ', ' ---' ), '', $message );
return $email;
}
add_filter( 'wpforms_email_message', 'wpf_dev_email_message', 10, 2 );
Just to note that this only works when you switch the email template to a plain text format.
In case it helps, here’s our tutorial with the most common ways to add custom code like this.
For the most beginner-friendly option in that tutorial, I’d recommend using the Code Snippets plugin.
Hope this helps 🙂