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 notify a WP user of form submission IF certain conditions are met

  1. First off, we love Gravity Forms and use it for every single website we make. It is awesome! Now that I've gotten that out of the way...

    I've come across a pretty unique project proposal and I'm trying to figure out if Gravity will make these functionality possible. Here's what I'm trying to achieve:

    1. A registered user submits a form, creating a new post with with many custom fields for a product they are looking to sell (think classified ad style). By default, this post is "private" or hidden from all other users/visitors

    2. Other registered users have created a list of preferences when their account was created

    3. If the "classified" post mentioned in step 1 meets another user's preference criteria, notify these users that the post has been created and send them a link to view it

    4. Keep track of how many posts any given user has been given access to (i.e. "User X has been sent notifications for 10 posts, and User Y can access 4 posts based on their preferences")

    The basic idea here is to allow users to post a "classified add" of sorts that is sent to other users ONLY if it meets that other user's preference requirements. At first glance I was thinking I have to custom code this application but I got to thinking I might be able to make something really sweet with Gravity?

    Thoughts? Any help is greatly appreciated, thank you for your time!

    Posted 13 years ago on Wednesday September 28, 2011 | Permalink
  2. You can certainly do it, but not without a little work. Gravity Forms is not designed to do anything like this, but you could use the gform_post_submission in 1.5.x (gform_after_submission in 1.6 and later) hook to compare the custom fields with the other user's preferences, then send a notification to those users.

    You would need to know:

    • what the other user's preferences are
    • their email addresses
    • the custom fields in the recently submitted post
    • Post ID

    Then compare the custom fields that were submitted with the stored preferences, and if you have a match, send a notification email with the link to the post. The code will go in functions.php in your current theme, and you can hook it to a Gravity Forms function.

    Posted 13 years ago on Thursday September 29, 2011 | Permalink
  3. Thanks for the reply Chris, that make a lot of sense. I'm definitely comfortable digging into Gravity & PHP in general so I figured i could "make it work" but it seems like the core processes - post creation via form, email notifications, custom fields etc were already handled by Gravity.

    Good to hear you are not daunted by this prospect! HAHA, thanks again for the reply and if any Gravity experts reading this are interest in working on this project, please send us a message. Thanks!

    http://www.gravityhelp.com/forums/topic/dynamically-notify-a-wp-user-of-form-submission-if-certain-conditions-are-met-1

    Posted 13 years ago on Thursday September 29, 2011 | Permalink

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