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.

Email routing - adding BCC to sent to field

  1. Hi, I've set up 'email routing' based on conditional logic so that different people get the notification based on specific conditions, but when more than one email address is entered into a "send to" field, the other email users can see who else got the notification. This creates a problem when one of the hits "reply all" to the message. Is there a way to set up a bcc in the send to field?

    I see that someone posted this issue around a year ago and they were told that this feature was coming soon in an update. Has that happened yet?

    Posted 9 years ago on Monday December 31, 2012 | Permalink
  2. Routing cannot currently be used with BCC, only "To:". No features have been added to change that functionality. You can currently get around this restriction in the form builder by using the gform_pre_submission_filter:

    There is an example of adding BCC addresses to the notification on that page.

    Posted 9 years ago on Monday December 31, 2012 | Permalink
  3. Hi Chris,

    I don't fully understand the example. I've located the form_display.php file in the plugin editor. Do I add the example as is? I'm guessing not. I'm not sure how to apply the example to fit the needs of my situation. Can I simply add:

    add_filter("gform_pre_submission_filter", "pre_submission_filter");

    just below <?php on the first line?


    Posted 9 years ago on Monday December 31, 2012 | Permalink
  4. Do not edit any of the plugin files. The code in the example goes in your theme's functions.php:

    I will have that instruction added to the documentation page.
    [DONE - ch 2012.12.31]

    Posted 9 years ago on Tuesday January 1, 2013 | Permalink
  5. Ok. I added this snipet to the top of the functions.php file:

    add_filter("gform_pre_submission_filter", "pre_submission_filter");

    The site looks fine. I don't appear to have broken anything. :)

    If I am understanding correctly, this means that email recipients are now bcc. But why do I get an uneasy feeling from the example you cited at that I'm missing something? Is the snippet I added enough or do I need to add more?


    Posted 9 years ago on Wednesday January 2, 2013 | Permalink
  6. The line you added

    add_filter("gform_pre_submission_filter", "pre_submission_filter");

    will just run the function pre_submission_filter. If that function does not exist, adding the filter won't do anything. Is that the only line you added? If so, you didn't break anything but you didn't add any functionality either. You need to have a function "pre_submission_filter" and it needs to add your BCC addresses.

    Posted 9 years ago on Wednesday January 2, 2013 | Permalink
  7. Yes, that is all I added. So in the example:

    01 <?php
    03 add_filter("gform_pre_submission_filter", "add_bcc");
    04 function add_bcc($form){
    06 //creating list of emails based on fields on the form
    07 $bcc = $_POST["input_9"] . ","; //player 1 email
    08 $bcc .= $_POST["input_11"] . ","; //player 2 email
    09 $bcc .= $_POST["input_13"] . ","; //player 3 email
    10 $bcc .= $_POST["input_15"] . ","; //player 4 email
    11 $bcc .= $_POST["input_17"]; //player 5 email
    13 //setting notification BCC field to the list of fields
    14 $form["notification"]["bcc"] = $bcc;
    16 //returning modified form object
    17 return $form;
    18 }
    19 ?>

    What are the inputs? For example, "input_9". What are the "player" emails? For example, "player 1 email". Would the "player 1 email" in the example be replaced with an email address? What would I replace "input_9" with?

    Posted 9 years ago on Thursday January 3, 2013 | Permalink
  8. Player 1 email is the email address which was submitted by the user. It's stored in field 9 of the form. Player 2 email was submitted in field 11, etc.

    You will replace input_9 with the field that holds the address you want to receive the BCC.

    Posted 9 years ago on Friday January 4, 2013 | Permalink
  9. Brutus

    Hello - I also noticed the emails I've entered in the BCC field do not receive notifications when routing has been enabled. Is this still true with the latest version?

    If so, why are the BCC fields shown when routing is enabled? This is going to confuse many users like myself who have purchased the plugin. Why not get this functionality working in your plugin?

    Posted 9 years ago on Friday April 26, 2013 | Permalink
  10. David Peralty

    Brutus, the issue you are having is NOT the same as what is being described as well. The user above wants to route e-mails using the BCC field. Not route e-mails AND use the BCC field. Can you create your own post with this issue, including what exactly you've done, and what the issue is so we can better troubleshoot it?

    Posted 9 years ago on Friday April 26, 2013 | Permalink