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 Form - specific recipient for each post

  1. Hi - I'm going to be using Gravity Forms with AgentPress and what I'd like to do is put a contact form in each post which goes to a specific renter/landlord. Each property posting will have a different email address so I was wondering:

    if there was an easy way to either define a specific email address for each contact form in each post or

    connect a defined field in AgentPress to be the recipient for the gravity contact form?

    Thanks!

    Posted 14 years ago on Sunday December 26, 2010 | Permalink
  2. Gravity Forms has a feature called Routing on the Admin Notification, however this works based on user selection. It sounds like what you want to do is store the agents name as a custom field for the post, and then send the email notification to that email address? Is that correct?

    Posted 14 years ago on Monday December 27, 2010 | Permalink
  3. Pretty much. Essentially, what I'd like to do is associate each post (listing) with a specific email but they are not registered users or agents.

    If I use a custom field to specify that email address, how can I connect it to a gravity form?

    Thanks!

    Posted 14 years ago on Monday December 27, 2010 | Permalink
  4. Sure, this is possible by storing the email in a custom field with the post and then using available API hooks and some custom PHP to tell the email notification to send to this email address.

    Here is a forum post that tells you how to do this and includes a code sample:

    http://forum.gravityhelp.com/topic/send-email-notification-using-custom-field#post-13617

    You would place this custom code (after making your customizations to it, form id and custom field key may differ with yours) in your themes functions.php file.

    Posted 14 years ago on Monday December 27, 2010 | Permalink
  5. Great - where would I get the api hook from? And, should I only utilize the code posted by bruner on that link you sent me or look at the code from here (http://forum.gravityhelp.com/topic/sending-form-to-author-of-post) as well?

    Posted 14 years ago on Monday December 27, 2010 | Permalink
  6. The code in that example uses the API hook. You would follow the directions in that post that was provided with the code sample.

    You could also use the code in the post about sending form to author of post. It just depends on which you want to do. Send to an email stored in a custom field, or send to the author of the post. It's entirely up to you. Both will work depending on your use case.

    Posted 14 years ago on Monday December 27, 2010 | Permalink