Send a copy to yourself with Contact Form 7 in WordPress

I need to add a checkbox with text “Send a copy of this email to yourself” to Contact Form 7 in WordPress, so the sender can receive a copy of the message he sents.

I can’t find anything on google, so your help would be really appreciated.
Thank you.

Related posts

Leave a Reply

4 comments

  1. In the solutions above you can have two recipients, but you asked about a mail copy, so a carbon copy perhaps. The best practice is to use the “additional headers” functionality of the “contact form 7” wp plugin.

    enter image description here

    Good luck! 🙂

    P.S.: But with checkbox it is more complicated, you need to use JS validation in “Form” box.

  2. I am not using Contact Form 7 anymore but as far as I remember on the settings page of your form, there are two areas called Mail. The first one is for receipment and you can enable the other one by checking the checkbox Mail(2). That one is for copies.

    http://s.wordpress.org/extend/plugins/contact-form-7/screenshot-1.png?r=561651


    By the way, I recommend using: http://www.gravityforms.com/

    Very easy to use and lots of options to play with.

  3. add this code to your theme’s functions.php

     add_filter( 'wpcf7_additional_mail', 'my_wpcf7_use_mail_2_or_not', 10, 2 );
    
    function my_wpcf7_use_mail_2_or_not( $additional_mail, $cf ) {
        if ( 'yes' != $cf->posted_data['sendcopy'] )
            $additional_mail = array();
    
        return $additional_mail;
    }
    

    and alter the select tag to this:

    [select sendcopy "no" "yes"]
    

    Copy email form the one with mail tags that you receive and place it to the mail(2) field. and

    ticke the Mail(2). then your Mail(2) will be active only when they select “yes”.

  4. In the mailing address input field you can just add additional email addresses separated by a comma.

    +1 for Gravity Forms too. It’s developer licence is well worth the money a brilliant plugin.