• I use a basic plugin with the function below. What can I change to capture the object and update the object?

    I understand i’ll have to set the properties as shown on this page http://contactform7.com/2014/07/02/contact-form-7-39-beta/

    But this function isn’t firing at all. Would really appreciate some help, thanks

    function wpcf7_process (&$WPCF7_ContactForm) {
    
       $fullname = $WPCF7_ContactForm->posted_data['your-name'];
       $email = $WPCF7_ContactForm->posted_data['your-email'];
       $phone = $WPCF7_ContactForm->posted_data['phone'];
    
       (.......other code......)
    
    	$WPCF7_ContactForm->mail['body'] .= "=================";
    	$WPCF7_ContactForm->mail['body'] .= "\r\n";
    
    	$WPCF7_ContactForm->mail['body'] .= 'HTTP_REFERER: '.$_SERVER['HTTP_REFERER'];
    	$WPCF7_ContactForm->mail['body'] .= "\r\n";
    
    }
    add_action("wpcf7_before_send_mail", "wpcf7_process");

    https://wordpress.org/plugins/contact-form-7/

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

    (@takayukister)

    function wpcf7_process (&$WPCF7_ContactForm) {

    You don’t need ‘&‘ before $WPCF7_ContactForm.

    $fullname = $WPCF7_ContactForm->posted_data['your-name'];

    WPCF7_ContactForm object no longer has posted_data property. See this thread for alternative.

    $WPCF7_ContactForm->mail['body'] .= "=================";

    WPCF7_ContactForm object no longer has public mail property. See Contact Form 7 3.9 Beta.

    This question seems to hover around the subject that I need help with (I think)…I am trying to get my contact form7 to save file attachments instead of deleting them. But I can’t seem to figure out how to do that (I’m fairly new to WP & still trying to get my bearings on handling code, etc.)…any advice?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘My plugin using wpcf7_before_send_mail isn't working’ is closed to new replies.