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.

Tell a Friend Form Query

  1. YMSA
    Member

    I came across this post:
    http://forum.gravityhelp.com/topic/creating-a-tell-a-friend-form-for-every-single-post

    I created a generic single Tell a Friend form (not linked to each post)

    Here is the problem:

    If A decides to tell their friend B, when B gets the email, it shows my email address, in the "FROM" section instead of A.

    In Notification to User it is set up as follows:

    Send to field: "Friend 1 Email" (i.e B)
    BCC: "Friend 2 Email', 'Friend 3 Email" (if A wants to also tell C and D)
    From Email: "Your Email" (i.e A) - this field actually asks for an email address
    Reply to: "Your Email" (i.e A) - this field actually asks for an email address

    How do I correct the above, so that it shows A email address, not mine?

    Thanks

    Posted 13 years ago on Friday September 3, 2010 | Permalink
  2. Hi there,

    Try this snippet: http://pastie.org/1138371

    This code will replace the the default "From" value of your "Notification to User" with the value of the "Your Email" field. In order for this to work you'll want to modify the snippet like so:

    1. add_action("gform_pre_submission_filter_12", "update_autoresponder");

      Update the "12" to whatever your form ID is.

    2. $form['autoResponder']['from'] = $_POST['input_2'];

      Update the "input_2" to whatever input ID your "Your Email" input is. You can find this by viewing the source of the form (http://grab.by/6eHs - see the name attribute of the input).

    Posted 13 years ago on Saturday September 4, 2010 | Permalink
  3. hegeman
    Member

    Hi, I'm using this snippet on some sites. But now that I have upgraded from gravity forms 1.4.5 to 1.5 and wp 3.04 to wp 3.1 it seems to have stopped working. Have there been any changes in the filters? Is it possible to provide an updated snippet that's working with the most recent versions?

    Thank you

    Posted 13 years ago on Wednesday April 6, 2011 | Permalink
  4. "add_action" should be "add_filter", see if that was the issue: http://pastie.org/1763838

    Posted 13 years ago on Wednesday April 6, 2011 | Permalink
  5. hegeman
    Member

    Hi David, I tried again and actually both work: add_action as well as add_filter.
    I found out now that I accidentally took the input id (which is in my case input_2_3) while I should have put in the input name (which is in my case input_3).

    Sorry, my mistake..... thanks a lot for helping me out!

    Posted 13 years ago on Wednesday April 6, 2011 | Permalink
  6. hegeman
    Member

    Another problem arises though. There are two tell-a-friend forms on the site, one for Dutch and one for English. As soon as I add a second snippet for the second form I get a error that I cannot redeclare update_autoresponder()

    Is there a way to add a similar snippet for the second form?

    Posted 13 years ago on Wednesday April 6, 2011 | Permalink
  7. @hegeman Yes, for the second form change update_autoresponder to like update_autoresponder2 or something like that. Just use a different name in the 2nd one wherever you have update_autoresponder. Can't declare it twice, so you need to use a different name.

    Posted 13 years ago on Wednesday April 6, 2011 | Permalink