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.

Dynamically populate "to" email address for form within short code?

  1. Hello,

    I have something that is a bit critical ... I am using GravityForms in conjunction with the SimpleMap plugin, and I'm rendering a form within a function that manipulates how SimpleMap will display.

    Within this function, I'm using the GF short code to display the form... but I need to be able to dynamically change what email address the submissions go to. They cannot go to a generic email address, but rather a specific one depending on the location being viewed.

    I've seen a custom function here on the forum that allows the "to" email address to be dynamically changes, but I'm already populating a return variable to send back to the browser for SimpleMaps ...

    Any ideas?

    Posted 9 years ago on Wednesday June 20, 2012 | Permalink
  2. David Peralty

    Their is e-mail routing built into admin notifications. Have you had a look at that? Go to notifications, select routing, and have a look at the logic you can use within it.

    Posted 9 years ago on Wednesday June 20, 2012 | Permalink
  3. That's not going to help me at all...

    This needs to happen when the page is rendered... and I'm not going to create 400+ rules for each individual email that exists.

    Posted 9 years ago on Wednesday June 20, 2012 | Permalink
  4. David Peralty

    Can you tell me more about how you would like it to work, and we can see if I can think of any way that Gravity Forms can help you do that...

    You can have an empty field that is populated on form load, but where would it get the value of what e-mail address it should load into the form?

    Posted 9 years ago on Wednesday June 20, 2012 | Permalink
  5. Even if I have to, I'll use jQuery to extract it from the page ... it's not getting the email address that's the issue, it's using it.

    I just need to know how to tell the form to send the email to whomever i want dynamically.

    Posted 9 years ago on Thursday June 21, 2012 | Permalink
  6. David Peralty

    Could you create an e-mail field, pre-populate it (however you want) and just hide the field using CSS? Then you could still assign that field in the notifications section to be where e-mails go.

    Posted 9 years ago on Thursday June 21, 2012 | Permalink