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.

Create User with submission...

  1. I have read through the forums and understand the GF is not set up by default to create users, but that it can be done with some PHP work. Here is the submission form on my site:

    http://livefitrevolution.com/?page_id=656

    What I would like to happen is for WP to be able to pull the email field from that submission and create a new user. So, it addition to the notification email that they receive for filling out the form, they also receive an email from WP with the password to their user account. I have purchased Wishlist Member and am going to be using many of their features to control which users see what content, and I will also have their log-in widget in my sidebar.

    So, what is the best way to pull the email address from the submission form into the WP database as a new user? Thanks...

    Jason.

    Posted 13 years ago on Sunday June 13, 2010 | Permalink
  2. I am still trying to figure this out. I have read about people using GF to do this, but I can't find specific instructions anywhere. How can I make GF work with WP do do this? Thanks.

    Jason.

    Posted 13 years ago on Wednesday June 16, 2010 | Permalink
  3. Per the email I sent you and for anyone else looking for information on how to accomplish this... here is a bare bones list of most of the required pieces:

    1. First, you'll need to add an action using the gform_post_submission hook. You can find details on this here: http://www.gravityhelp.com/documentation/hooks-and-filters/
    2. The gform_post_submission hook will pass a variable that contains the entry data: $entry. This variable is an array of all the submitted entry values form the form, including the email field if this is present in the form.
    3. After you have your email address, you'll want to create the new user. You can find details on how to do this here: http://codex.wordpress.org/Function_Reference/wp_create_user
    4. The wp_create_user function will return the id of the newly created user. Using this id you can update the user with additional information (most likely also pulled from the submitted form). You can find more details on this here: http://codex.wordpress.org/Function_Reference/wp_update_user

    These are the major pieces. There are some other factors that need to be considered to fully flush out this concept, but it's a good start for anyone trying implement this functionality.

    Posted 13 years ago on Thursday June 17, 2010 | Permalink