title: Change CF7 Form values dynamically
body: <p>I've been attempting to change CF7 form fields dynamically <strong>without using Contact Form 7 Dynamic Text Extension</strong>. I've seen a ton of articles on how to get posted data, just not on how I can overwrite existing values. My goal is to dynamically change the file attachment and add other meta-data associated with each post. Can this be done? Thank you!</p>
  
  <p>Here's what I have so far:</p>
  
  <pre><code>function wpcf7_custom_before_send(&amp;$cf7) {
      if ( $cf7-&gt;id == 4 ) {
          $submission = WPCF7_Submission::get_instance();
          if ( $submission ) {
              $data =&amp; $submission-&gt;get_posted_data();
              // how do I overwrite posted data?
          }
      }
  }
  add_action("wpcf7_before_send_mail", "wpcf7_custom_before_send");
  </code></pre>