• Resolved ceralis

    (@ceralis)


    Hello

    I used the variable {all_non_empty_fields} for my notification email

    Problem in the email still displays the section and html fields

    How to remove them from the notification email?

    Thank you for your help

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Patrick – WPMU DEV Support

    (@wpmudevsupport12)

    Hi @ceralis

    I hope you are doing well.

    Could you please try this script created by our developers?
    https://gist.github.com/wpmudev-sls/0b77c787918033b5087a012a45a0204f

    You can install it as a mu-plugin following this guide:
    https://premium.wpmudev.org/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins

    This will exclude the HTML, I pinged the developers to check if we can extend for sections too.

    We will update once hearing back from the team.
    Best Regards
    Patrick Freitas

    Plugin Support Patrick – WPMU DEV Support

    (@wpmudevsupport12)

    Hi @ceralis

    Could you please add a comment on this section of that code?

    if ( 'section' === $field_type && ! $form_field_obj->is_hidden( $field_array, $data, $pseudo_submitted_data ) ) {
    	$value = $form_field->__get( 'section_title' );
    	if ( ! empty( $value ) ) {
    		$html .= '</ol>';
    		$html .= '<h4><b>' . $value . '</b></h4>';
    		$html .= '<ol>';
    	}
    } 

    It should look like:

    if ( 'section' === $field_type && ! $form_field_obj->is_hidden( $field_array, $data, $pseudo_submitted_data ) ) {
    	// $value = $form_field->__get( 'section_title' );
    	// if ( ! empty( $value ) ) {
    	// 	$html .= '</ol>';
    	// 	$html .= '<h4><b>' . $value . '</b></h4>';
    	// 	$html .= '<ol>';
    	// }
    } 

    Then the section should be skipped too.

    Let us know the result you got.
    Best Regards
    Patrick Freitas

    Thread Starter ceralis

    (@ceralis)

    Hello

    Thanks it works!

    But finally I kept the sections because otherwise I have all my fields in a row and the email is not readable.

    The best of the best would be to be able to just delete the sections whose fields are empty

    Thank you for your help

    Freddy

    Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hi @ceralis

    We do have some significant improvements planned for these notifications for future, indeed.

    Some of them include additional (code level) filters for those notification variables but there are also some enhancements to this planned as well as nice templates and better message editor so all together – I believe this should get way better in future.

    But also thank you for sharing your suggestions, such feedback is always super-useful for us!

    Best regards,
    Adam

    Thread Starter ceralis

    (@ceralis)

    Hello

    Thank you again for your help and your responsiveness.

    I will be able to use it like this, and I can’t wait to see what’s new

    Have a good day

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Remove section and html fields notification email’ is closed to new replies.