Skip to content

Hooks and Filters

The WPify Raynet plugin provides filters to customize data before it is sent to Raynet CRM.

Each form plugin integration has its own filter, called right before the data is sent to Raynet. Use these to modify, enrich or validate the lead data.

Filter Contact Form 7 data before sending to Raynet.

apply_filters( 'wpify_raynet_cf7_data', RaynetData $raynet_data, array $form, array $cf7_data );

Parameters:

  • $raynet_data (RaynetData) — Lead data object
  • $form (array) — Form mapping configuration
  • $cf7_data (array) — Raw CF7 submission data

Example — add source notice:

/**
* Add source notice to lead from Contact Form 7
*
* @param RaynetData $raynet_data Lead data object
* @param array $form Form configuration
* @param array $cf7_data CF7 data
* @return RaynetData
*/
function my_cf7_add_source_notice( $raynet_data, $form, $cf7_data ) {
$raynet_data->notice = 'Source: website contact form';
return $raynet_data;
}
add_filter( 'wpify_raynet_cf7_data', 'my_cf7_add_source_notice', 10, 3 );

Example — add custom fields from CF7:

/**
* Add custom fields from CF7 form to lead
*
* @param RaynetData $raynet_data Lead data object
* @param array $form Form configuration
* @param array $cf7_data CF7 data
* @return RaynetData
*/
function my_cf7_custom_fields( $raynet_data, $form, $cf7_data ) {
// Add product interest from CF7 field
if ( ! empty( $cf7_data['product-interest'] ) ) {
$raynet_data->custom_fields['product_interest'] = $cf7_data['product-interest'];
}
return $raynet_data;
}
add_filter( 'wpify_raynet_cf7_data', 'my_cf7_custom_fields', 10, 3 );

Filter Fluent Forms data before sending to Raynet.

apply_filters( 'wpify_raynet_fluent_data', RaynetData $raynet_data, array $form, array $form_data );

Parameters:

  • $raynet_data (RaynetData) — Lead data object
  • $form (array) — Form mapping configuration
  • $form_data (array) — Raw Fluent Forms submission data

Filter Ninja Forms data before sending to Raynet.

apply_filters( 'wpify_raynet_ninja_data', RaynetData $raynet_data, array $form, array $form_data );

Parameters:

  • $raynet_data (RaynetData) — Lead data object
  • $form (array) — Form mapping configuration
  • $form_data (array) — Raw Ninja Forms submission data

Filter WP Forms data before sending to Raynet.

apply_filters( 'wpify_raynet_wpforms_data', RaynetData $raynet_data, array $form, $entry );

Parameters:

  • $raynet_data (RaynetData) — Lead data object
  • $form (array) — Form mapping configuration
  • $entry (array) — Raw WP Forms submission data

Filter the final API request arguments before sending to Raynet. This is the last filter applied before the HTTP request.

apply_filters( 'wpify_raynet_request_args', array $request_args );

Parameters:

  • $request_args (array) — HTTP request arguments including headers, body, etc.

Example — add custom field to API request:

/**
* Add custom field to API request
*
* @param array $request_args Request arguments
* @return array
*/
function my_raynet_custom_field( $request_args ) {
$request_args['body']['customField1'] = 'custom_value';
return $request_args;
}
add_filter( 'wpify_raynet_request_args', 'my_raynet_custom_field' );

The $raynet_data object passed to integration filters has the following properties:

PropertyTypeDescription
topicstringLead topic (required)
first_namestringFirst name
last_namestringLast name
emailstringPrimary email
email_2stringSecondary email
phonestringPrimary phone
phone_2stringSecondary phone
company_namestringClient name
streetstringStreet address
citystringCity
postcodestringPostal code
countrystringCountry
provincestringProvince/Region
wwwstringWebsite URL
reg_numberstringRegistration number
other_contactstringOther contact info
noticestringNote/description
notification_messagestringNotification message
notification_emailsarrayNotification email addresses
categorystringLead category (code list ID)
contact_sourcestringContact source (code list ID)
territorystringTerritory (code list ID)
ownerstringLead owner (code list ID)
latstringLocation latitude
lngstringLocation longitude
custom_fieldsarrayCustom field key-value pairs

You can add custom functions either in your child theme’s functions.php or use the Code Snippets plugin.