• Resolved capo123

    (@capo123)


    How to eneble wpforms_email_display_empty_fields,

    add_filter( ‘wpforms_email_display_empty_fields’,array(&$this,true) ); is not working.

Viewing 1 replies (of 1 total)
  • Plugin Support Ethan Choi

    (@ethanchoi)

    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 🙂

Viewing 1 replies (of 1 total)

The topic ‘wpforms_email_display_empty_fields’ is closed to new replies.