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.

Send Notification to all in a Category

  1. I'm using a GF Form as an Enquiry Form on individual posts/listings. See example here - http://www.stayanight.co.za/v3/portside-inn

    I capture a Custom Field called "Res_Email" when the post is published and I'm able to use the GF Enquiry Form to e-mail a Notification to this "Res_Email" once the form is submitted.

    What I want to know is if it is possible to do the same for a Category View?

    Eg. I search for accommodation and get the following result - http://www.stayanight.co.za/v3/category/accommodation/eastern-cape/east-london

    Now I want to insert my GF Enquiry form at the bottom of my Category View page (This I can do) and once the form is submitted I want a Notification Email to go out to all the Posts (Custom Field = "Res_Email") that are displayed on the page...

    The use is that this will allow a visitor to send a request to all the Guest Houses displayed on the search result page by only completing 1 GF Form.

    Posted 12 years ago on Wednesday April 18, 2012 | Permalink
  2. GZA
    Member

    We're looking for similar feature but only posts (listings) the site visitor has added to their favourites list.

    Posted 12 years ago on Wednesday April 18, 2012 | Permalink
  3. Is this possible? Sure. But it isn't something that can be done easily.

    It's easy to send the admin notification to an email address associated with a custom field for an individual page or post that the form is displayed on. As you know, that can be done simply by using merge tags and the WordPress custom field functionality.

    However, doing the same thing with multiple posts that are displayed on a category page? Much more complex.

    You can send the admin notification email to whoever you want using the gform_notification_email hook to define where the notification should be sent. That hook is documented here:

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

    The complexity involved is you would have to write custom PHP that can get ALL of those custom field emails across all of the posts appearing on that category page and then combine those values into a single string that you then pass to the gform_notification_email hook.

    It is even more complex if paging is involved on your category page. Is it supposed to get all of them or just the ones that appear on that page?

    So it is certainly possible. You can tell Gravity Forms to send the email notification to wherever you want using PHP. But you need to be able to know how to get those emails from wherever they are stored in order to do so.

    Posted 12 years ago on Thursday April 19, 2012 | Permalink
  4. GZA
    Member

    Thank you Carl, makes perfect sense and the pagination issue is a consideration I hadn't thought of.

    Personally, for our project, we would only want this functionality for posts that the user has marked as favourites.

    To send emails to ALL posts in a particular category is fraught with problems, especially is you have a couple of hundred posts (listings).

    Posted 12 years ago on Thursday April 19, 2012 | Permalink