Skip to:
Content
Pages
Categories
Search
Top
Bottom

Infusionsoft and Forum Role


  • PDidee
    Participant

    @pdidee

    I was wondering if it’s possible to assign a forum role to users being updated through Infusionsoft via HTTP Post. Not sure what the corresponding meta key would be or if that should just be a “add” to the role.

Viewing 5 replies - 1 through 5 (of 5 total)

  • Robin W
    Moderator

    @robin-w

    you can use the function

    bbp_set_user_role( $user_id, $new_role)

    $new_role will need bbp_ in front eg bbp_keymaster, bbp_participant etc.


    PDidee
    Participant

    @pdidee

    Thanks for the quick reply!
    Okay and if it’s a custom role will that work as well? Like ‘bbp_cadet’?

    HTTP Post function - Infusionsoft


    Robin W
    Moderator

    @robin-w

    should do


    PDidee
    Participant

    @pdidee

    Should it be “bbp_cadet” after the equals? I think I forgot that above.


    radgh
    Participant

    @radgh

    (@pdidee asked about this on a slack channel, thought I would leave my solution here)

    HTTP Post is basically the same thing as a form submission. Consider this example from the infusionsoft link you sent:

    HTTP Post form field example from infusionsoft

    That is basically like having a form that is submitted to your website at the URL you choose, with the field names (left) and values (right).

    Here is an example of what you should send from Infusionsoft:

    contactId = ~Contact.Id~
    access_key = [your access key]
    bbp_action = set_role
    bbp_role = cadet

    When your website gets that data, nothing happens. BBPress and WordPress do not know what to do with that data you came up with. You have to make that data do something.

    Here is an example that will handle that URL. It is not tested:

    https://gist.github.com/RadGH/38473c6ebcda730cedadd49de1ad0348

    You need to change the value of “$internal_access_key” to match your access key.

    You will probably also need to change the meta key used in the WP_User_Query which I set as “infusionsoft_contact_id”. I’m guessing infusionsoft does store that data on your users, but may be under a different key. Check the infusionsoft plugin documentation and hopefully you can find it there.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Skip to toolbar