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 another email address to the autoresponder

  1. I would like users to apply for a training course buy filling out a form, then I would like a notification to be sent to the user, the training company and the admin of the site.

    What would be the best way to achive this, I have looked at this code but didnt understand it.

    <?php
    add_filter("gform_autoresponder_email", "change_notification_email", 10, 2);
    function change_notification_email($email, $form){
    
        //applying notification routing to form Id 2
        if($form["id"] != 2)
            return $email;
    
        //creating email list from fields 2 and 3.
        return $_POST["input_2"] . "," . $_POST["input_3"];
    }
    
    ?>

    many thanks

    Posted 13 years ago on Wednesday December 7, 2011 | Permalink
  2. If you want the form to send an email to the user then you would configure the User Notification for that form by editing Notifications for that form.

    If you want the form to send an email to the admin then you would configure the Admin Notification for that form by editing Notifications for that form.

    The 3rd one, training company, is the one you need to figure out how to handle. Where is the email address for this 3rd one coming from? Is it dynamic based on a selection in the form? Is it always the same for that form?

    If it's always the same then simply use the BCC field on the Admin or User Notification to send them a copy of whichever notification you want.

    Posted 13 years ago on Wednesday December 7, 2011 | Permalink
  3. thanks for your reply.

    The site I am working allows training companies to create post of training courses they offer, the user can then book a course with the provider, so the 3rd address will be for the training company. This will differ as we'll have several different companies. I have set up a custom post with a custom field which they enter their email. I have also set up a hidden field on the form which gets populated with the email and that works fine.

    I just need to somehow get the email to be copied and sent to the training company email as well as notifications to the user and admin.

    many thanks

    Posted 13 years ago on Wednesday December 7, 2011 | Permalink
  4. Thanks for your help, I have now got it working.

    Just saw a post where you can just add field variables to the send fields, so as you said I added the hidden field 'email' to the 'bcc' field.

    Love this plugin, think I'm to get a developer license.

    thanks again

    Posted 13 years ago on Wednesday December 7, 2011 | Permalink

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