• Hello,
    I have this hook to convert all user input to uppercase in notification emails, the code in functions.php is the one below.
    Now I would like to implement the code to exclude the EMAIL and URL fields, how can I do it?
    Thx

    add_filter( 'wpcf7_mail_tag_replaced',
     
      function( $replaced, $submitted, $html, $mail_tag ) {
        if ( is_string( $submitted ) ) {
          $replaced = strtoupper( $submitted );
        }
     
        return $replaced;
      },
     
      10, 4
    );

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    Thread Starter enricotv

    (@enricotv)

    Thank you,

    I’ve read the link but unfortunately I’m newbie with php so I don’t know precisely the syntax and tags. Could you please help me in a little more detail?

    Thanks a lot

    Thread Starter enricotv

    (@enricotv)

    Hi,

    I tried with this code change but the form is not submitted when clicking submit. Where is the problem?

    Thank you

    add_filter( 'wpcf7_mail_tag_replaced',
     
      function( $replaced, $submitted, $html, $mail_tag ) {
        if ( is_string( $submitted ) ) {
          $replaced = strtoupper( $submitted );
        }
    	if ( 'EMAIL' == $mail_tag->field_name() ) {
    		if ( is_string( $submitted ) ) {
    			$replaced = strtolower( $submitted );
    		}
    	}
        return $replaced;
      },
     
      10, 4
    );
    
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Email submitted converted in UPPERCASE except email and url’ is closed to new replies.