WordPress.org

Forums

Contact Form 7
[resolved] Contact form 7 send me a copy multilingual (8 posts)

  1. omichon
    Member
    Posted 1 year ago #

  2. omichon
    Member
    Posted 1 year ago #

    I finally find a way to do it with this code :

    function my_wpcf7_use_mail_2_or_not( $additional_mail, $cf ) {
    	if ( "" == $cf->posted_data['send_copy'][0] )
    		$additional_mail = array();
    	return $additional_mail;
    }

    That was quite simple, but not that much for the newbie I am.

  3. omichon
    Member
    Posted 1 year ago #

    The code from my previous post doesn't work anymore because of some changes in v3.9 (WPCF7_ContactForm object no longer has a posted_data property.). Any help to adapt this code for v3.9 would be welcome.
    Thanks in advance.

  4. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 1 year ago #

  5. omichon
    Member
    Posted 1 year ago #

    Thanks for the link. I was able to point out the issue from reading it, but I am unable to adapt the new code to my function. I am just a real newbie to php :(

  6. omichon
    Member
    Posted 1 year ago #

    Just had to try harder. All is fine again :)

  7. hjvf
    Member
    Posted 1 year ago #

    Hi.
    Tell me how to alter the code for the new version. I'm new to wp.

  8. omichon
    Member
    Posted 1 year ago #

    I changed the previous code like this :

    function my_wpcf7_use_mail_2_or_not( $additional_mail, $cf ) {
    $cf = WPCF7_Submission::get_instance();
    if ( $cf ) {
    	$posted_data = $cf->get_posted_data();
    }
    
    	if ( "" == $posted_data['send_copy'][0] )
    		$additional_mail = array();
    
    	return $additional_mail;
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Contact Form 7
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic