PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Adding Carbon Copy

  1. There are lots of post on this but none of them give an example of how one might go about it so I'm hoping to create a post here that others can use to solve this issue until it becomes a core feature.

    I'm trying to allow the sender to send themselves a copy of the message. Right now I have it so on post submission if the checkbox is checked I'm getting the email field but I need to know the best way to duplicate the notifications.

    Here is what I have:

    add_action("gform_post_submission_1", "my_submit_form", 10, 2);
    
    function my_submit_form($entry){
    //if checkbox value is set to true then display the email address
    if($entry["4.1"] =="true"){
    die ($entry["2"]);
    }
    }

    This is just a simple test to get the email address. Now my question is, can I use a built in form feature to send a copy of the message or should i use wp_mail or mailto() instead? An example would be awesome

    Posted 12 years ago on Friday April 13, 2012 | Permalink
  2. If I understand correctly, all you need to do is set the email in the notification's BCC field.
    The following doc page should point you in the right direction.
    http://www.gravityhelp.com/documentation/page/Gform_pre_submission_filter

    Posted 12 years ago on Friday April 13, 2012 | Permalink
  3. Thanks that did the trick

    For anyone who wants to do this here is a snippit:

    add_action("gform_pre_submission_filter", "my_submit_form", 10, 2);
    
    function my_submit_form($form){
           //check if checkbox value is set to the correct value
    	if($_POST['input_id'] =="value"){  //id and value of the checkbox here
    
           //Send Email to the OP
        	$bcc  = $_POST["input_id"]; // id of the email field here
    
        //setting notification BCC field to the list of fields
        $form["notification"]["bcc"] = $bcc; 
    
         return $form;  //return
    
    	}
    //box not checked return
       else{ return $form;  }
    }
    Posted 12 years ago on Friday April 13, 2012 | Permalink
  4. Thanks for posting your solution.

    Posted 12 years ago on Saturday April 14, 2012 | Permalink

This topic has been resolved and has been closed to new replies.