Please Note: We are no longer using forums to facilitate standard support. 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.

set custom fields after a form is submitted

  1. timmee
    Member

    I am using the Email Users plugin from MarvinLabs.

    Plugin Details: http://www.marvinlabs.com/products-and-references/wordpress-addons/email-users/

    The plugin adds two checkboxes to the user profile:

    • Accept to recieve post or page notification emails
    • Accept to recieve emails sent to multiple recipients (but still accept emails sent only to me)

    I would like to populate these fields in my custom user registration form, but how?

    I have asked on the MarvinLabs forum, but they referred me back here: http://forums.marvinlabs.com/topic/gravity-forms-integration

    I am not sure which questions to ask. MarvinLabs said I should ask here "if there is a way to set some custom fields after a form is submitted. If that is possible, then it should not be a problem."

    Some feedback or pointers in the right direction would be greatly appreciated.

    Posted 4 years ago on Sunday July 24, 2011 | Permalink
  2. Hi timmee. I downloaded that plugin and configured the Gravity Forms User Registration Add-on to work with it. Here's what you need to do.

    In your registration form, add two check boxes. [These are going to be added later to your user registration feed (on the User Registration menu under Forms.)] I copied the wording from the "Email Users" plugin exactly (although I fixed a typo.)

    [ ] Accept to receive post or page notification emails
    [ ] Accept to receive emails sent to multiple recipients (but still accept emails sent only to me)

    You will have to check "enable values" here and set the value for both of these to true (lowercase.) That's how the plugin expects to find the meta values.

    Here's a screenshot of the form setup for these two check boxes I added: http://minus.com/mboO2hL#2

    Now that you've set up the check boxes in your registration form, go to Forms > User Registration and edit your existing feed. You are going to map these two check boxes to two specific custom fields.

    There is a section near the end of all the fields you've already mapped called "User Meta". If you are not already mapping fields in the registration form to WordPress profile fields, you will see a drop down that says "Select Meta Option" by default, with nothing in the select box next to it. Pull down the select and scroll to the bottom, "Add Custom". A little AJAX refresh will happen and that box will become empty. You are going to add two specific custom fields here. These are used by the Email Users plugin.

    email_users_accept_notifications
    email_users_accept_mass_emails

    Those two values will be the custom meta keys, and you will need to select the proper form field on the right (from the drop down.) That will map the key (on the left) to your form field (on the right) and the value that will be used for the meta value is "true" (which you set in your form previously.)

    After you enter the first one, click the little plus sign on the right of the form field select box and you will get another line. Select Add Custom here and then enter the second meta key (email_users_accept_mass_emails) then map that to the proper check box from your form.

    The keys and check boxes need to match up like this:

    email_users_accept_notifications is the
    Accept to receive post or page notification emails
    check box

    email_users_accept_mass_emails is the
    Accept to receive emails sent to multiple recipients (but still accept emails sent only to me)
    check box

    Screenshot of these two custom fields being added and mapped to the two check box fields:
    http://minus.com/mboO2hL

    If you need any more help, please let us know.

    Posted 4 years ago on Sunday July 24, 2011 | Permalink
  3. timmee
    Member

    Chris, thank you very much for taking the time to post such a detailed reply.

    I am sorted!

    Posted 4 years ago on Tuesday August 9, 2011 | Permalink

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

Support Tickets

Open A New Support Ticket
 Open A New Priority Support Ticket *

* Developer license holders only