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.

Contact from Author Template

  1. I am building a real estate site. I'm using Custom Post Types to create a Properties type and on that page is an option to contact the agent who listed the property.

    On the author page (using author.php), I would like to include a Gravity Form. Since I anticipate many, many authors/agents, I would rather not have to create a template and form for each.

    Can anyone recommend the best way to achieve this? I assume it will be conditional logic / routing - but I'm not sure how I can capture the author/agents email address in the form.

    Any help would be greatly appreciated!

    Posted 13 years ago on Wednesday November 16, 2011 | Permalink
  2. Do you store the email for the agent who listed the property with the post? Is it available as a custom field for that post? If so then this should be easy.

    Here is a post that discusses how to do this:

    http://www.gravityhelp.com/forums/topic/get-routing-email-address-via-post-custom-field#post-32303

    If the email is not available with the post then that poses an issue. The email would have to be available somehow, preferably as a custom field on the listing post or the post author's email.

    Posted 13 years ago on Wednesday November 16, 2011 | Permalink
  3. Thanks for the response. That is definitely a work around that I'd consider. Ideally, I'd like to have the email read from the Users database, but I'm thinking that's probably not possible?

    Posted 13 years ago on Wednesday November 16, 2011 | Permalink
  4. If the information is stored in your database then you should be able to do it. It may require a little custom PHP, but you can dynamically populate fields using custom PHP... as long as you know where to get the data.

    My example used available merge tags. If it's coming from somewhere then you would use PHP to dynamically populate that email field with the rest of the steps being relatively the same as in the post I linked to.

    Here is how a field can be dynamically populated:

    http://www.gravityhelp.com/documentation/page/Using_Dynamic_Population

    Posted 13 years ago on Wednesday November 16, 2011 | Permalink
  5. OK thanks - I think it may be beyond my PHP skills for the moment, but something to consider for the future. I'll go with the custom field option for now.

    Thanks again.

    Posted 13 years ago on Friday November 18, 2011 | Permalink

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