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.

Sending form results to the user of the post the form was sent from

  1. marmaris
    Member

    We have one general reservation form that caters to the hotel listings that registered users on our site post. When the form is filled out, we have a hidden field showing us from which post the form was filled in from (basically the name of the hotel). The form is sent to our administration email. What we require is that the forms are sent to not the admin email but to the email address of the user who posted that hotel listing so that they know they have a new reservation lead. Is this possible?

    Thank you in advance for the assistance.

    Posted 13 years ago on Friday May 20, 2011 | Permalink
  2. Yes this is possible. It requires a customization to use an available API hook to set the Send To address dynamically. So it does require some custom code that you would add to your themes functions.php file.

    Here is a post that discusses how to do this:

    http://www.gravityhelp.com/forums/topic/sending-form-to-author-of-post

    We are also going to look into how to easily handle this as a native feature in a future release.

    Posted 13 years ago on Friday May 20, 2011 | Permalink
  3. marmaris
    Member

    Thank you Carl. The link you gave me, I read it. To accomplish this task I used this code in order to have all the hotel listings go to the email address of the user who added that hotel listing. Works like a charm! However, ever time a user adds a new hotel listing, I have to go into that listing and insert via shortcode, the gravity forms "Reservation Form" on the hotel listing page in order for this "new" code to work. Here is the code I used. I inserted it as is into my theme's function.php file at the very bottom:

    <?php add_filter( 'gform_notification_email_3', 'route_notification', 10, 2 );
    function route_notification($email_to, $entry) {
    global $post;
    $email_to = get_the_author_email();
    return $email_to = get_the_author_meta('email', $post->post_author);
    }
    ?>

    Posted 13 years ago on Saturday May 21, 2011 | Permalink
  4. Are you using Gravity Forms to create the hotel listing? If so you can use the Content Template feature of the Post Body field and output the shortcode there so it will automatically be added.

    Your other option is to create a custom post template and insert the PHP function call to the form in the template along with the content of the post in the loop in the template. Then it doesn't have to be added to the post manually, the template would display it.

    Posted 13 years ago on Monday May 23, 2011 | Permalink
  5. marmaris
    Member

    I am using a real estate template from gorilla themes which is how i found out about gravity forms. There is a add a listing page (in this case add a hotel) using gravity forms to add the listing from the website as a posting, using the isrealestate id to see it as a listing and not a regular post so that when the form is filled, approved it shows up as a listing on the website. I am not familiar with creating a custom post template or php coding as i am not a programmer. so i would not know where to begin to create one. Here's the link to the site if you wish to see what i've done. http://www.marmariskonaklama.com ... Thank you again. Your idea, if i could do it would be most ideal. I just figured that as listing came in, seeing as we have to approve them first, i would just add the shortcode.

    Posted 13 years ago on Thursday May 26, 2011 | Permalink