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.

Refer information to a friend/associate

  1. From what I understand, if I want to have an email sent to a third party, I need to setup a notification depending on a selection made within a drop down menu. But this looks like you already need a set email to have it sent to.

    We are potentially wanting to have a custom notification sent to an email that would be provided by the person filling out the form. Depending on how they answer either have that email sent out or just have the company contact the individual if an email is not available.
    Can I achieve something like this through gravity?

    Posted 14 years ago on Monday November 29, 2010 | Permalink
  2. Gravity Forms supports 2 default notifications.

    The Admin Notification which is designed to go to you or someone associated with the site. It can be sent to multiple people via CC or BCC. It can be customized via custom code using api hooks.

    The User Notification is designed to go to the person filling out the form. It is an autoresponder that executes as soon as the form is submitted. You can use it to send a confirmation to the user filling out the form, etc. It is also customizable via custom code using api hooks.

    Posted 14 years ago on Monday November 29, 2010 | Permalink
  3. Im not too familiar with the api hooks, but would it be safe to assume that the CC could be sent to a "friends" email that they provide through the form?

    Posted 14 years ago on Monday November 29, 2010 | Permalink
  4. I don't believe there is a hook for the CC field, however there is a hook for the TO field so you could use custom code to change the TO field so it sends to multiple email addresses.

    Posted 14 years ago on Monday November 29, 2010 | Permalink
  5. perfect. Thanks for your help!

    Posted 14 years ago on Monday November 29, 2010 | Permalink
  6. TotzPelton
    Member

    I am looking to use the TO field hooks you mentioned Carl, but I am unclear where to find the API reference. I am trying to use the example at:

    http://www.gravityhelp.com/documentation/hooks-and-filters/

    but I'm not sure this is what I need. Can you point me to a resource?
    Thanks!

    Posted 14 years ago on Friday February 18, 2011 | Permalink
  7. This hook isn't in the documentation on that page. It's in the new developers documentation that will be launching at the end of this month with the final release of 1.5.

    The hook you use to set the Send To address of the User Notification is the gform_autoresponder_email hook.

    Here is an example of this hook being used.

    <?php
    add_filter("gform_autoresponder_email", "change_notification_email", 10, 2);
    function change_notification_email($email, $form){
    //creating email list from fields 2 and 3.
    return $_POST["input_2"] . "," . $_POST["input_3"];
    }
    ?>`

    The example above returns the values of 2 fields from a form as the Send To address.

    If you want to apply this only to a specific form you would change this:

    add_filter("gform_autoresponder_email", "change_notification_email", 10, 2);

    To this:

    add_filter("gform_autoresponder_email_1", "change_notification_email", 10, 2);

    The 1 in the above add_filter call that was added to gform_autoresponder_email is the form id. This way you can specify a specific form.

    Posted 14 years ago on Friday February 18, 2011 | Permalink