XF 2.2 Fluent Forms

El Porcharo

Well-known member
I'm about to buy Fluent Forms service, as I want to show a conversational form to users that wants to join my community and I also need to manage all this within my main website.

Fluent Forms already supports a lot of services (1500+) but I don't see XenForo in the list...

Does anyone know if it's possible to at least create a XF account within an external form platform at all?

Here is their API documentation: https://fluentforms.com/docs-category/developer-docs/
 
By the looks of their developer docs it would be easy to do things like create accounts, promote usergroups, send alerts/conversations, and possibly some other actions with my XFtoWP plugin.

The boilerplate for all of those actions are already in the plugin, and Fluent Forms provides the hooks to simply run them at the correct time.

PM me if you want to brainstorm and possibly work together on this.
 
To back that up a little bit, here's a simple example that will register a user on form submission. I don't have Fluent Forms so this is untested and needs further detailing, but the basics are covered:
  1. Hook into a Fluent Form submission (fluentform_before_submission_confirmation)
  2. Call xf_request() to send an API request to your XF board
  3. When finished, creates user with form data
Note: This is WordPress code only and can be pasted into your child theme functions.php or functionality plugin.

PHP:
/**
 * Register user and perform other actions based on form IDs.
 *
 * References:
 * https://fluentforms.com/docs/fluenform_before_submission_confirmation/
 * https://wpfluentforms.com/docs/form-object/
 * https://xftowp.com/docs/
 */

function custom_xfwp_fluent_forms( $entryId, $formData, $form ) {

    // Change Form ID of `5` to register XF user on submit.
    if ( $form->id == 5 ) {
        xf_request( 'POST', 'users', array(
            'body' => array(
                'username' => $formData['username'],
                'email' => $formData['email'],
                'password' => $formData['password']
            )
        ) );
    }

    return false;
}

add_action( 'fluentform_before_submission_confirmation', 'custom_xfwp_fluent_forms', 20, 3 );

Good start, this may be worth finishing. :D
 
Top Bottom