Search Results

Bento Webhooks

[…] users’ meta data and tags. Having trouble receiving webhooks? Check out our troubleshooting guide. Setup Navigate to Bento » Automate and create a new workflow to handle the webhook. Select a ‘Trigger’ (such as New Pageview). Add an action and Select Send Webhook. In the webhook settings, configure the webhook like in the screenshot […]

Read More

FluentCRM Webhooks

With FluentCRM Pro v2.2.0 and higher, you can use webhooks in automations to connect to WP Fusion installed on ano ther site. Using webhooks you can import new users on your WordPress site based on rules in FluentCRM, or update existing users’ meta data and tags. For example, you could sell access to a […]

Read More

Mailchimp Webhooks

You can use webhooks in Mailchimp to send data back to your WordPress site using WP Fusion. Using these webhooks, you can create new users on your WordPress site, or update existing users’ meta data and tags. Having trouble receiving webhooks? Check out our troubleshooting guide. There are two ways to configure webhooks in Mailchimp, either […]

Read More

The WP Fusion User Class

As we discussed in the first section, WP Fusion achieves its flexibility and extensibility by standardizing the way WordPress communicates with different CRM systems. The first section covered how to interface with your selected CRM directly by utilizing the wp_fusion()->crm object. Those methods are “low level”, they require you to already know the contact ID of the contact you want to edit, and do very little in terms of validation of data or redundancy checking. So while WP Fusion’s CRM class deals with contacts and contact data, the WPF_User class deals with WordPress users and user data. This class works like a central dispatch, taking incoming events and data from our various plugin integrations and routing it to the appropriate method in your selected CRM. A basic example of how this all works, using LifterLMS When a student completes a lesson in LifterLMS, LifterLMS triggers the ‘lifterlms_lesson_completed’ action. In our LifterLMS integration file, we have a function attached to this hook. This function checks to see if any tags have been configured to be applied when the lesson is marked complete. If there are tags to apply, the function then calls: wp_fusion()->user->apply_tags( $tags, $user_id ); In the apply_tags() function, we first check to see if there is a contact ID available for that user. If the user doesn’t have a contact record, then nothing else happens. Then we check the user’s current tags and see if the tags being applied are actually new. If the user already has the tag, then we don’t need to send an unnecessary API call. Then apply_tags() sends the new tags to the CRM wrapper class (discussed in the previous article), by calling: wp_fusion()->crm->apply_tags( $tags, $contact_id ); It checks the response from the API call, and if there were any errors, these are recorded in WP Fusion’s error log for troubleshooting purposes. Finally we update the tags stored in in the usermeta table for that user, at ‘{crm_slug}_tags’ so they can be quickly accessed again in the future. The available methods in the WPF_User class: user_register() wp_fusion()->user->user_register( $user_id, $post_data = null, $force = false ); This function is triggered whenever a user registers on your site, from any plugin or other source. It can also be manually called to create a new CRM contact from an existing user ID. Parameters: $user_id (int) (Required) The ID of the user you’d like to use to create the new contact $post_data (array) (Optional) You can pass in additional data you’d like to be included with the new contact. If this is left blank, WP Fusion will attempt to get as much data as possible out of the database $force (bool) (Optional) If you have the setting for “Create Contacts” disabled in the WP Fusion settings, then you can set this argument to true to force creating a new contact. Return values: $contact_id (int) The contact ID of the new contact false (bool) If there wasn’t enough data available to create a new contact, or if there was an API connection failure get_contact_id() wp_fusion()->user->get_contact_id( $user_id, $force_update = false ); Gets the contact ID for a user from their local user meta, or forces an update of the contact ID by looking up their email address in your CRM. Parameters: $user_id (int) (Required) The ID of the user you’d like to get the contact ID for $force_update (bool) (Optional) If set to true, this will force an update of the saved contact ID for the user by looking up their email address in your CRM Return values: $contact_id (int) The contact ID of the user false (bool) If the user has no contact ID saved on the site, or if WP Fusion was unable to locate their email address in your CRM get_tags() wp_fusion()->user->get_tags( $user_id, $force_update = false ); Gets the tags for a user from their local user meta, or forces an update of their tags by performing an API call. Parameters: $user_id (int) (Required) The ID of the user you’d like to get the tags ID for $force_update (bool) (Optional) If set to true, this will force an update of the saved tags for the user by force-checking their contact ID and then re-loading the user’s tags from your CRM Return values: $user_tags (array) An array of tag IDs applied to the contact. Will be an empty array if no tags were found false (bool) If the user has no contact ID saved on the site, or if WP Fusion was unable to locate their email address in your CRM pull_user_meta() wp_fusion()->user->pull_user_meta( $user_id ); Loads the latest meta data from the CRM contact record for the specified user, and updates their saved data on your site. Parameters: $user_id (int) (Required) The ID of the user you’d like to load from the CRM Return values: $user_meta (array) An array of WordPress meta fields and their values that were loaded for the user false (bool) If the user has no eligible meta to load, or if there was an error loading their contact record push_user_meta() wp_fusion()->user->push_user_meta( $user_id, $user_meta = false ); Pushes meta data for a user from WordPress to your CRM. Parameters: $user_id (int) (Required) The ID of the user you’d like to update $user_meta (array) (Optional) An associative array of WordPress meta keys and values to update. If left blank, WP Fusion will send all meta data found for that user in the database. Return values: true (bool) The contact was successfully updated false (bool) If the user has no saved contact ID, or there was no eligible meta data to send apply_tags() wp_fusion()->user->apply_tags( $tags, $user_id = false ); Applies an array of tags to a user. Parameters: $tags (array) (Required) An array of tag IDs to apply to the user $user_id (int) (Optional) The user to apply the tags to. Will use the current logged in user if left blank Return values: true (bool) The tags were successfully applied false (bool) If no contact ID was found for the user, or if the user already had the specified tags and no API call was needed remove_tags() wp_fusion()->user->remove_tags( $tags, $user_id = false ); Removes an array of tags from a user. Parameters: $tags (array) (Required) An array of tag IDs to remove from the user $user_id (int) (Optional) The user to remove the tags from. Will use the current logged in user if left blank Return values: true (bool) The tags were successfully removed false (bool) If no contact ID was found for the user, or if the user didn’t have those tags in the first place import_user() wp_fusion()->user->import_user( $contact_id, $send_notification = false, $role = false ); This function imports a contact from your CRM, by contact ID, and creates a new WordPress user. If a user already exists with the same contact ID, that user will just be updated. New users will be given a randomly generated password. If you have enabled “Return Password” in the WP Fusion settings, this password will be stored back to their contact record. Parameters: $contact_id (int) (Required) The contact ID to import $send_notification (bool) (Optional) Whether to send the new user the default WordPress welcome email $role (bool / string) (Optional) If provided, the new user will be given the specified role. Otherwise they will be created with the site default role. Return values: $user_id (int) The ID of the new user (or existing user if updated) $error (WP Error object) If there was an API error importing the user, or if the loaded contact data didn’t contain an email address Utility and helper functions: get_user_id() wp_fusion()->user->get_user_id( $contact_id ); Looks up a user by their contact ID. Parameters: $contact_id (int / string) (Required) The contact ID to search by Return values: $user_id (int) The ID of the user false (bool) If no user was found with that contact ID has_tag() wp_fusion()->user->has_tag( $tag, $user_id = false ); Checks a given user to see if they have the specified tag. Parameters: $tag (int / string) (Required) The tag ID or tag label to check for $user_id (int) (Optional) The user ID to check. Will default to the current user ID if left blank Return values: true (bool) The user has the tag false (bool) The user does not have the tag get_tag_id() wp_fusion()->user->get_tag_id( $tag_label ); For CRMs that use internal IDs for their tags (like Infusionsoft), this function will return the tag ID for a given tag label. Parameters: $tag_label (string) (Required) The tag label to check for Return values: $tag_id (int / string) The internal ID for the supplied tag label false (bool) If no tag was found with that label get_tag_label() wp_fusion()->user->get_tag_label( $tag_id ); For CRMs that use internal IDs for their tags (like Infusionsoft), this function will return the tag label for a given tag ID. Parameters: $tag_id ( int / string) (Required) The tag ID to check for Return values: $label (string) The tag label for that ID. If no tag […]

Read More

Ontraport Webhooks

[…] rules in Ontraport, or update existing users’ meta data and tags. Having trouble receiving webhooks? Check out our troubleshooting guide. Using Rules (Ontraport Pro accounts) Go to the Rules page under the Contacts menu in the sidebar and create a new rule. Select a trigger for the rule, such as when a new contact […]

Read More

Platform.ly Webhooks

[…] WordPress site based on rules in Platform.ly, or update existing users’ meta data and tags. Having trouble receiving webhooks? Check out our troubleshooting guide. Getting started Go to the My Automations page in your Platform.ly account and create a new automation. Select a trigger for the workflow, such as when a contact is given a […]

Read More

FunnelKit Webhooks

With FunnelKit Pro, you can use webhooks in automations to connect to WP Fusion installed on ano ther site. Using webhooks you can import new users on your WordPress site based on rules in FunnelKit, or update existing users’ meta data and tags. For example, you could sell access to a course using WooCommerce […]

Read More

Ortto Webhooks

[…] data and tags. Having trouble receiving webhooks? Check out our troubleshooting guide. Setup In Ortto, head to More » Data Sources and click New Data Source. Enter the URL to your site, with the access_key and wpf_action parameters (see below). You can un-check the setting for Send activity payload. Otherwise leave the settings as their […]

Read More

Emercury Webhooks

[…] we’ll be showing you how to create a new WordPress user when a contact is added to your Emercury list. See below for additional options when constructing the URL parameters. From the webhooks screen, first click Add to create a new webhook. In the popup that appears, give the webhook a name, set the […]

Read More

Mautic Webhooks

[…] a contact’s profile has been updated. You can also automatically generate new WordPress user accounts for Mautic contacts. Having trouble receiving webhooks? Check out our troubleshooting guide. There are two ways to set up webhooks with Mautic. Either globally, or part of a campaign: Global webhooks Global webhooks apply to all contacts in Mautic. […]

Read More

NationBuilder Webhooks

Note: Currently webhooks are hidden in NationBuilder. To access them, visit https://{{yournation}}.nationbuilder.com/admin/webhooks/new. You can use webhooks in NationBuilder to send data back to your WordPress site using WP Fusion. Using webhooks you can create new users on your WordPress site when people are added in NationBuilder, or update existing users’ meta data and tags when people […]

Read More

ThriveCart

Using WP Fusion with ThriveCart you can create a success URL pointed at your site that will create a new WordPress user and log them in so they can access their purchased content. Heads up! This is an advanced feature. It is one of the more difficult things to set up with WP Fusion. […]

Read More

Double Opt-Ins

[…] reputation by reducing bounce rates and spam complaints. Each CRM that WP Fusion supports handles double opt-ins in a different way. Here’s how to make use of the features in WP Fusion, as well as the features unique to each CRM. Opt-in management in WP Fusion’s plugin integrations WP Fusion includes features across our […]

Read More

Switching CRMs

The time may come when you need to move from one marketing automation platform to another. Thankfully WP Fusion makes this pretty easy. Here are the steps: 1. Move your data To ensure that no data gets lost in the transfer, the best way to move your contacts over is to do an […]

Read More

Kartra Webhooks

You can use Kartra’s outbound API to send data back to your WordPress site using WP Fusion. Using these webhooks, you can create new users on your WordPress site based on rules in Kartra, or update existing users’ meta data and tags. Having trouble receiving webhooks? Check out our troubleshooting guide. Getting started Webhooks are managed in Kartra under My Integrations >> API >> API. If you’re already logged into your Kartra account, you should be able to access this page by following this link. For this tutorial, we’ll be showing you how to create a new WordPress user when a specific […]

Read More

Engage Webhooks

[…] tags. Having trouble receiving webhooks? Check out our troubleshooting guide. Setup In Engage, create a new automation, and select a trigger. In this case we are triggering the automation when a subscriber’s email address changes. Add a new action, and from the dropdown, choose Call webhook. Set the Webhook URL following the examples below. Webhook URL […]

Read More

MooSend Webhooks

[…] users’ meta data and tags. Having trouble receiving webhooks? Check out our troubleshooting guide. Setup Navigate to MooSend » Automations and create a new automation to handle the webhook. Select a trigger (such as a tag being applied), add a new step and click the Actions and select theThen post a webhook”. Enter […]

Read More

Groundhogg Webhooks

You can use webhooks in Groundhogg to sync contact data back to WP Fusion installed on ano ther website. Webhooks can be used to automatically import Groundhogg contacts as new WordPress users, or trigger an update of existing users’ metadata and tags. Note: This tutorial only applies if you are using WP Fusion to […]

Read More

Customer.io Webhooks

[…] webhooks? Check out our troubleshooting guide. Setup First create a new journey in Customer.io and select a trigger, for example when someone is added to a segment. In the workflow editor, select Send and Receive Data from the side panel, and connect it to your trigger. In the webhook settings, enter the URL to your site […]

Read More

Blockli Streamer

[…] CRMs and marketing automation systems. When a user watches one of your Blockli Streamer videos on your WordPress site, your selected tags will be automatically applied to the user on your CRM of choice. WP Fusion supports applying tags in your CRM based on completing a video and starting a video. Tagging When configuring […]

Read More