title: In wordpress how to set custom response message for CF7
body: <p>I want to set custom response message for CF7. Once I submitted through CF7, I will get the response output from wp_remote_post method but unable to show response error message in CF7 form. I have the following code. Please guide me how can I set custom response error message.</p>
  
  <pre><code>add_filter( 'wpcf7_before_send_mail', 'create_tocken' );
  
  function create_tocken( $contact_form ) {
      global $wpdb;
  
      if ( ! isset( $contact_form-&gt;posted_data ) &amp;&amp; class_exists( 'WPCF7_Submission' ) ) {
          $submission = WPCF7_Submission::get_instance();
  
          if ( $submission ) {
              $form_data = $submission-&gt;get_posted_data();
          }
      } else {
          return $contact_form;
      }
  
      $body = array(
          'username' =&gt; 'xxxxx',
              'password' =&gt; 'xxxxxx',
              'type' =&gt; 'xxxxx',
              'name' =&gt; 'xxxxxx',             
              'phone' =&gt; 'xxxxxx', 
              'email' =&gt; 'xxxxxx',               
              'town' =&gt; 'xxxxxx', 
      );
  
      $url = 'https://example.com/';
  
      $params = array(
          'headers' =&gt; array(
              'Content-Type' =&gt; 'application/x-www-form-urlencoded'
          ),
          'body' =&gt; $body
      );
  
      $response = wp_remote_post( $url,  $params );
  
      if ( is_wp_error( $response ) ) {
          $error_message = $response-&gt;get_error_message();
  
      }
  
  
  }
  </code></pre>
  
  <p>Here I wanted to set  $error_message as a custom response message.</p>