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.

Insert $_POST or $_GET value

  1. pettedemon
    Member

    Hi,
    I would like to add a field that retrieves a variable in $ _GET or $ _POST.
    I would like to add this variable in mail.
    How can I do?

    Posted 13 years ago on Friday January 28, 2011 | Permalink
  2. Do you want people to be able to access a form, and have a value in that form populated via GET or POST (pre-populated)?

    All values in a form, no matter how they got there (manually entered or pre-populated) are available to use in email notifications.

    Please explain more what you're trying to do and someone will help point you to the solution.

    Posted 13 years ago on Monday January 31, 2011 | Permalink
  3. pettedemon
    Member

    I would like to insert a form field with the email you send to another more complete form that takes in $ _GET mail and let others fill in the fields

    Posted 13 years ago on Tuesday February 1, 2011 | Permalink
  4. So assuming you're passing the variable in the URL like so:

    http://yoururl.com/yourform/?email=user@gmail.com

    Just set the dynamic population parameter of the field you'd like to pre-populate with the query string variable you'd like to populate it from. In this case that would be "email".

    Posted 13 years ago on Tuesday February 1, 2011 | Permalink
  5. peter
    Member

    http://yoururl.com/yourform/?email=user@gmail.com is nice, but i need to have it slightly different, i don't want to show the email in the url, instead i want to use a variable and get the emailaddres attached to it something like: http://yoururl.com/yourform/?email=recipient1 and where the system knows that user@gmail.com attached to recipient1 and user945@gmail.com is attached to recipient945 for example with a get value before the pipe. Example:
    recipient945@gmail.com|recipient945,
    recipient1@gmail.com|recipient1,
    recipient11@gmail.com|recipient11, and so on

    or if someone has a different solution please let me know!

    Posted 13 years ago on Tuesday December 20, 2011 | Permalink
  6. You can do this, send whatever value you want in the query string, but the page that receives that request will need to handle the routing of the emails then. Are you talking about your form being the page to receive the query (so, prepopulate a field in the form with a value) or are you talking about after the form is submitted?

    If you want your form to accept the email parameter, you can do this, then use routing in the admin notifications to say "If the email value in the query string is recipient11, send the email notification to chris@rocketgenius.com". This is built in now. Is that what you're trying to do? It seems unrelated to the original poster's question, so I am having a hard time following along. If you post more details about your situation, we'll be happy to help.

    Posted 13 years ago on Tuesday December 20, 2011 | Permalink
  7. peter
    Member

    this is exactly what i need, how do i accomplish this?

    Posted 13 years ago on Wednesday December 21, 2011 | Permalink
  8. Take a look at this page:
    http://gravity.chrishajer.com/pre-populate-everything/

    If you don't send any parameters in the URL/query string, the values will be populated with the pre-population values I set in the shortcode when I inserted the form into the page. You won't be doing that I don't think, but here's what the shortcode looks like in case anyone is wondering:

    [php]
    [gravityform id="61" title="false" field_values="fullname=chris&highschool=Kennedy&fruit=Star&shoe=11"]

    In the form, for every field, I have checked the box on the Advanced tab '"Allow field to be populated dynamically". After you do that, you will see a text field that asks for "Parameter Name". For each field, enter the name of the parameter you will use in your query string. In your example, you used 'email' but I would suggest 'recipient' since it's more accurate (you are sending the recipient name, not the email.)

    The URL you use in that case will look like this:
    http://gravity.chrishajer.com/pre-populate-everything/?recipient=recipient1 (that won't work for my site)

    Imagine this though:
    http://gravity.chrishajer.com/pre-populate-everything/?fruit=star+fruit

    That will pre-populate the "fruit" field with "star fruit" (I used a plus there so the link is not broken here.) You will do the same, but it will be "?recipient=recipient1" where the parameter name for your recipient field is 'recipient'.

    That's the first part of the setup. Be sure the field that holds the recipient name is a drop down, radio button or checkbox. It can't be a free form entry. It can be a hidden field if you don't want to show it. You might want to have one of the values be a default if someone arrives at the URL without the query string or strips it off for some reason.



    The second part is called routing. That is configured on the notifications tab in the form builder. Click on Notifications, then select the radio button for "Routing." Documentation

    Your routing will be set to say "Send to [enter your email address] if [field drop down] [is or is not] [whatever values are available in the field you selected from the drop down]"

    Perform that for each recipient.

    It's easier to set up than to explain. Set up the field and allow it to be populated dynamically, first, and get that working, then work on the notification routing. I think it will all make sense once you get into it. Please ask questions as you go along. Thank you.

    Posted 13 years ago on Wednesday December 21, 2011 | Permalink
  9. peter
    Member

    Hi, i've been digging into this method

    http://www.gravityhelp.com/forums/topic/dynamic-population-notification-strategy

    almost done setting it up... if i've got questions can i ask you to assist?

    Posted 13 years ago on Wednesday December 21, 2011 | Permalink
  10. peter
    Member

    i think i've got a issue with the " $account = $lead[4];" what is this and what should it do?
    and there's a issue when submitting the form, can give you the form url in a PM so if you got some spare time you can check it out

    Posted 13 years ago on Wednesday December 21, 2011 | Permalink
  11. peter
    Member

    please check and submit the form to see the error
    http://www.ves.nl/4499-2/?accountID=1

    and the list function also does not work!

    Posted 13 years ago on Wednesday December 21, 2011 | Permalink
  12. Please send an email to chris@rocketgenius.com with a link to this topic and the questions you have at this point and I will see if I can help you.

    Posted 13 years ago on Thursday December 22, 2011 | Permalink
  13. peter
    Member

    in your inbox!

    Posted 13 years ago on Thursday December 22, 2011 | Permalink
  14. peter
    Member

    i've used all the settings as in the example, but still no luck... HELP

    Posted 13 years ago on Thursday December 22, 2011 | Permalink
  15. Hi Peter - I have your emails and will look at this on Friday. Thanks for your patience.

    Posted 13 years ago on Friday December 23, 2011 | Permalink
  16. peter
    Member

    thanks in advance!

    Posted 13 years ago on Friday December 23, 2011 | Permalink
  17. @peter, can you resend your email or tell me what address it came from? I received a lot of email on Friday and seem to have misplaced yours. Thank you.

    Posted 13 years ago on Tuesday December 27, 2011 | Permalink
  18. peter
    Member

    in your mailbox again
    it's the same as my account email address peterlammers ät msñ døt cóm

    Posted 13 years ago on Tuesday December 27, 2011 | Permalink
  19. Peter, I am not receiving your emails. Let me send you one then reply to me. Thanks.

    Posted 13 years ago on Wednesday December 28, 2011 | Permalink
  20. I have emailed peter the solution. We'll update this topic when the problem is ultimately resolved. The correct field was being populated by the query string, but the code was looking at the wrong $lead[id].

    Posted 12 years ago on Saturday December 31, 2011 | Permalink