Skip to content

Instantly share code, notes, and snippets.

@lorenzocaum
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lorenzocaum/fdaaf3f643004cf26856 to your computer and use it in GitHub Desktop.
Save lorenzocaum/fdaaf3f643004cf26856 to your computer and use it in GitHub Desktop.
How to send additional information over to Infusionsoft using the Infusionsoft integration for Event Espresso 3

Event Espresso 3 has the following kinds of question types:

Text (TEXT)

Text Area (TEXTAREA)

Radio Button (SINGLE)

Drop down (DROPDOWN)

Checkbox (MULTIPLE)

You can locate the type of question type by going to Event Espresso --> Questions. The third column shows the type:

http://cl.ly/image/0g2f3A2u2u2o

The type must be correct for the information to be transferred correctly. In the example above, we have created a custom question called Website. We are then populating it by using a Question Type of TEXT. The numeric value that appears next to is is the question ID. With the first example above, we are populating an existing system field in Infusionsoft for website by using a TEXT question type with an ID of 11.

The second example is for a custom fields that was created in Infusionsoft. Note that custom fields must begin with and underscore. Here are some examples:

_FavoriteColor

_BeverageChoice

Similar to the first example, we must match the use the correct question type and use the correct ID:

http://cl.ly/image/0I1E402I1M0s

The sample coding can be added to your child theme's functions.php file or a site specific plugin.

<?php
//* Do NOT include the opening php tag
//* Send additional information over to Infusionsoft
function ee_espresso_infusionsoft_save_extra_fields($attendee_data) {
$clean_attendee_data = array(
//Example of standard (pre-existing) contact data field field in Infusionsoft
'Website' => isset($_REQUEST['TEXT_11']) ? $_REQUEST['TEXT_11'] : '' ,
//Example of a custom contact data field
//NOTE: You must prepend custom field database names with an underscore when accessing them through the API
'_CustomQuestion' => isset($_REQUEST['TEXT_14']) ? $_REQUEST['TEXT_14'] : '' ,
);
return array_merge($attendee_data, $clean_attendee_data);
}
add_filter( 'filter_hook_espresso_infusionsoft_extra_attendee_data', 'ee_espresso_infusionsoft_save_extra_fields', 10, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment