• Hi

    i know about the sollution of hiding HTML Fields in email with “forminator-hide-html-all-non-empty”

    but what i need is to hide some Fields, not all, i made a configurator with about 65 Fields, there are many HTML Fields with an explaination, some Fields with Images…

    this images i want to hide in email

    Here i have to find a sollution to disable some fields to shows up in email, other not…
    can i disable some fields with a Code?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Imran – WPMU DEV Support

    (@wpmudev-support9)

    Hello @winock !

    I hope you’re doing great!

    That’s possible with a snippet:

    <?php
    
    add_action(
    	'forminator_custom_form_mail_before_send_mail',
    	function( $mail_class, $custom_form, $data, $entry ) {
                    $exclusions = [
                            "html-1",
                            "html-2",
                    ];
    		$fields = $custom_form->fields;
    		if ( ! empty( $fields ) ) {
    			foreach ( $fields as $k => $v ) {
    				if ( false !== in_array( $v->slug, $exclusions ) {
    					unset( $custom_form->fields[ $k ] );
    				}
    			}
    		}
    	},
    	10,
    	4
    );

    To configure the snippet, please add the IDs of the fields to the $exclusions array like this:

    $exclusions = [
      "html-1",
      "html-2",
    ];

    Then save the code to a .php file and upload the file to wp-content/mu-plugins/ directory (please create it if it doesn’t exist).

    Kind regards,
    Pawel

    Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @winock ,

    We haven’t heard from you for several days now, so it looks like you don’t have more questions for us.

    Feel free to re-open this ticket if required.

    Kind regards
    Kasia

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hide some HTML Fields in E-Mail’ is closed to new replies.